diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-07-16 23:23:25 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-07-16 23:23:25 -0400 |
commit | 2b9c85a41b190c6843000f18b922946bd6bd3bed (patch) | |
tree | bc3ea7a222fbe2bbfe6da37586631b504dd70a50 /firmware/export | |
parent | 805f5316325eea37a90b5299b4a3ba601077f0a5 (diff) | |
download | rockbox-2b9c85a41b190c6843000f18b922946bd6bd3bed.tar.gz rockbox-2b9c85a41b190c6843000f18b922946bd6bd3bed.zip |
storage: Clean up storage_xxxx macros when STORAGE_MULTI is not set
Change-Id: I1652eac1743f4b8b84da08ea5a6d04ac7e17e21d
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/storage.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/firmware/export/storage.h b/firmware/export/storage.h index 8ff06c8744..e6424f7b03 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h | |||
@@ -118,11 +118,12 @@ static inline void stub_storage_spin(void) {} | |||
118 | static inline void stub_storage_spindown(int timeout) { (void)timeout; } | 118 | static inline void stub_storage_spindown(int timeout) { (void)timeout; } |
119 | static inline int stub_storage_event(long id, intptr_t data) | 119 | static inline int stub_storage_event(long id, intptr_t data) |
120 | { return 0; (void)id; (void)data; } | 120 | { return 0; (void)id; (void)data; } |
121 | static inline void storage_sleep(void) {}; | ||
121 | #else /* ndef HAVE_HOSTFS */ | 122 | #else /* ndef HAVE_HOSTFS */ |
122 | #if (CONFIG_STORAGE & STORAGE_ATA) | 123 | #if (CONFIG_STORAGE & STORAGE_ATA) |
123 | void storage_sleep(void); | 124 | void storage_sleep(void); |
124 | #else | 125 | #else |
125 | static inline void storage_sleep(void) {} | 126 | static inline void storage_sleep(void) {}; |
126 | #endif | 127 | #endif |
127 | #endif /* HAVE_HOSTFS */ | 128 | #endif /* HAVE_HOSTFS */ |
128 | 129 | ||
@@ -132,11 +133,11 @@ static inline void storage_sleep(void) {} | |||
132 | */ | 133 | */ |
133 | #define storage_num_drives() NUM_DRIVES | 134 | #define storage_num_drives() NUM_DRIVES |
134 | #if defined(HAVE_HOSTFS) | 135 | #if defined(HAVE_HOSTFS) |
135 | #define STORAGE_FUNCTION(NAME) (stub_## NAME) | 136 | #define STORAGE_FUNCTION(NAME) (stub_storage_## NAME) |
136 | #define storage_event stub_storage_event | 137 | #define storage_event stub_storage_event |
137 | #define storage_spindown stub_storage_spindown | 138 | #define storage_spindown(sec) stub_storage_spindown(sec) |
138 | #define storage_sleep stub_storage_sleep | 139 | #define storage_sleep() stub_storage_sleep() |
139 | #define storage_spin stub_storage_spin | 140 | #define storage_spin() stub_storage_spin() |
140 | 141 | ||
141 | #define storage_enable(on) | 142 | #define storage_enable(on) |
142 | #define storage_sleepnow() | 143 | #define storage_sleepnow() |
@@ -160,9 +161,8 @@ static inline void storage_sleep(void) {} | |||
160 | #define storage_driver_type(drive) hostfs_driver_type(IF_MV(drive)) | 161 | #define storage_driver_type(drive) hostfs_driver_type(IF_MV(drive)) |
161 | #elif (CONFIG_STORAGE & STORAGE_ATA) | 162 | #elif (CONFIG_STORAGE & STORAGE_ATA) |
162 | #define STORAGE_FUNCTION(NAME) (ata_## NAME) | 163 | #define STORAGE_FUNCTION(NAME) (ata_## NAME) |
163 | #define storage_spindown ata_spindown | 164 | #define storage_spindown(sec) ata_spindown(sec) |
164 | #define storage_spin ata_spin | 165 | #define storage_spin() ata_spin() |
165 | |||
166 | #define storage_enable(on) ata_enable(on) | 166 | #define storage_enable(on) ata_enable(on) |
167 | #define storage_sleepnow() ata_sleepnow() | 167 | #define storage_sleepnow() ata_sleepnow() |
168 | #define storage_disk_is_active() ata_disk_is_active() | 168 | #define storage_disk_is_active() ata_disk_is_active() |
@@ -184,8 +184,8 @@ static inline void storage_sleep(void) {} | |||
184 | #define storage_driver_type(drive) (STORAGE_ATA_NUM) | 184 | #define storage_driver_type(drive) (STORAGE_ATA_NUM) |
185 | #elif (CONFIG_STORAGE & STORAGE_SD) | 185 | #elif (CONFIG_STORAGE & STORAGE_SD) |
186 | #define STORAGE_FUNCTION(NAME) (sd_## NAME) | 186 | #define STORAGE_FUNCTION(NAME) (sd_## NAME) |
187 | #define storage_spindown sd_spindown | 187 | #define storage_spindown(sec) sd_spindown(sec) |
188 | #define storage_spin sd_spin | 188 | #define storage_spin() sd_spin() |
189 | 189 | ||
190 | #define storage_enable(on) sd_enable(on) | 190 | #define storage_enable(on) sd_enable(on) |
191 | #define storage_sleepnow() do {} while (0) | 191 | #define storage_sleepnow() do {} while (0) |
@@ -208,8 +208,8 @@ static inline void storage_sleep(void) {} | |||
208 | #define storage_driver_type(drive) (STORAGE_SD_NUM) | 208 | #define storage_driver_type(drive) (STORAGE_SD_NUM) |
209 | #elif (CONFIG_STORAGE & STORAGE_MMC) | 209 | #elif (CONFIG_STORAGE & STORAGE_MMC) |
210 | #define STORAGE_FUNCTION(NAME) (mmc_## NAME) | 210 | #define STORAGE_FUNCTION(NAME) (mmc_## NAME) |
211 | #define storage_spindown mmc_spindown | 211 | #define storage_spindown(sec) mmc_spindown(sec) |
212 | #define storage_spin mmc_spin | 212 | #define storage_spin() mmc_spin() |
213 | 213 | ||
214 | #define storage_enable(on) mmc_enable(on) | 214 | #define storage_enable(on) mmc_enable(on) |
215 | #define storage_sleepnow() mmc_sleepnow() | 215 | #define storage_sleepnow() mmc_sleepnow() |
@@ -232,8 +232,8 @@ static inline void storage_sleep(void) {} | |||
232 | #define storage_driver_type(drive) (STORAGE_MMC_NUM) | 232 | #define storage_driver_type(drive) (STORAGE_MMC_NUM) |
233 | #elif (CONFIG_STORAGE & STORAGE_NAND) | 233 | #elif (CONFIG_STORAGE & STORAGE_NAND) |
234 | #define STORAGE_FUNCTION(NAME) (nand_## NAME) | 234 | #define STORAGE_FUNCTION(NAME) (nand_## NAME) |
235 | #define storage_spindown nand_spindown | 235 | #define storage_spindown(sec) nand_spindown(sec) |
236 | #define storage_spin nand_spin | 236 | #define storage_spin() nand_spin() |
237 | 237 | ||
238 | #define storage_enable(on) (void)0 | 238 | #define storage_enable(on) (void)0 |
239 | #define storage_sleepnow() nand_sleepnow() | 239 | #define storage_sleepnow() nand_sleepnow() |
@@ -256,8 +256,8 @@ static inline void storage_sleep(void) {} | |||
256 | #define storage_driver_type(drive) (STORAGE_NAND_NUM) | 256 | #define storage_driver_type(drive) (STORAGE_NAND_NUM) |
257 | #elif (CONFIG_STORAGE & STORAGE_RAMDISK) | 257 | #elif (CONFIG_STORAGE & STORAGE_RAMDISK) |
258 | #define STORAGE_FUNCTION(NAME) (ramdisk_## NAME) | 258 | #define STORAGE_FUNCTION(NAME) (ramdisk_## NAME) |
259 | #define storage_spindown ramdisk_spindown | 259 | #define storage_spindown(sec) ramdisk_spindown(sec) |
260 | #define storage_spin ramdisk_spin | 260 | #define storage_spin() ramdisk_spin() |
261 | 261 | ||
262 | #define storage_enable(on) (void)0 | 262 | #define storage_enable(on) (void)0 |
263 | #define storage_sleepnow() ramdisk_sleepnow() | 263 | #define storage_sleepnow() ramdisk_sleepnow() |
@@ -284,6 +284,7 @@ static inline void storage_sleep(void) {} | |||
284 | #else /* CONFIG_STORAGE_MULTI || !HAVE_HOSTFS */ | 284 | #else /* CONFIG_STORAGE_MULTI || !HAVE_HOSTFS */ |
285 | 285 | ||
286 | /* Multi-driver use normal functions */ | 286 | /* Multi-driver use normal functions */ |
287 | #define STORAGE_FUNCTION(NAME) (storage_## NAME) | ||
287 | 288 | ||
288 | void storage_enable(bool on); | 289 | void storage_enable(bool on); |
289 | void storage_sleepnow(void); | 290 | void storage_sleepnow(void); |