summaryrefslogtreecommitdiffstats
path: root/firmware/export
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-16 23:23:25 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-16 23:23:25 -0400
commit2b9c85a41b190c6843000f18b922946bd6bd3bed (patch)
treebc3ea7a222fbe2bbfe6da37586631b504dd70a50 /firmware/export
parent805f5316325eea37a90b5299b4a3ba601077f0a5 (diff)
downloadrockbox-2b9c85a41b190c6843000f18b922946bd6bd3bed.tar.gz
rockbox-2b9c85a41b190c6843000f18b922946bd6bd3bed.tar.bz2
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.h33
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) {}
static inline void stub_storage_spindown(int timeout) { (void)timeout; }
static inline int stub_storage_event(long id, intptr_t data)
{ return 0; (void)id; (void)data; }
+static inline void storage_sleep(void) {};
#else /* ndef HAVE_HOSTFS */
#if (CONFIG_STORAGE & STORAGE_ATA)
void storage_sleep(void);
#else
-static inline void storage_sleep(void) {}
+static inline void storage_sleep(void) {};
#endif
#endif /* HAVE_HOSTFS */
@@ -132,11 +133,11 @@ static inline void storage_sleep(void) {}
*/
#define storage_num_drives() NUM_DRIVES
#if defined(HAVE_HOSTFS)
- #define STORAGE_FUNCTION(NAME) (stub_## NAME)
+ #define STORAGE_FUNCTION(NAME) (stub_storage_## NAME)
#define storage_event stub_storage_event
- #define storage_spindown stub_storage_spindown
- #define storage_sleep stub_storage_sleep
- #define storage_spin stub_storage_spin
+ #define storage_spindown(sec) stub_storage_spindown(sec)
+ #define storage_sleep() stub_storage_sleep()
+ #define storage_spin() stub_storage_spin()
#define storage_enable(on)
#define storage_sleepnow()
@@ -160,9 +161,8 @@ static inline void storage_sleep(void) {}
#define storage_driver_type(drive) hostfs_driver_type(IF_MV(drive))
#elif (CONFIG_STORAGE & STORAGE_ATA)
#define STORAGE_FUNCTION(NAME) (ata_## NAME)
- #define storage_spindown ata_spindown
- #define storage_spin ata_spin
-
+ #define storage_spindown(sec) ata_spindown(sec)
+ #define storage_spin() ata_spin()
#define storage_enable(on) ata_enable(on)
#define storage_sleepnow() ata_sleepnow()
#define storage_disk_is_active() ata_disk_is_active()
@@ -184,8 +184,8 @@ static inline void storage_sleep(void) {}
#define storage_driver_type(drive) (STORAGE_ATA_NUM)
#elif (CONFIG_STORAGE & STORAGE_SD)
#define STORAGE_FUNCTION(NAME) (sd_## NAME)
- #define storage_spindown sd_spindown
- #define storage_spin sd_spin
+ #define storage_spindown(sec) sd_spindown(sec)
+ #define storage_spin() sd_spin()
#define storage_enable(on) sd_enable(on)
#define storage_sleepnow() do {} while (0)
@@ -208,8 +208,8 @@ static inline void storage_sleep(void) {}
#define storage_driver_type(drive) (STORAGE_SD_NUM)
#elif (CONFIG_STORAGE & STORAGE_MMC)
#define STORAGE_FUNCTION(NAME) (mmc_## NAME)
- #define storage_spindown mmc_spindown
- #define storage_spin mmc_spin
+ #define storage_spindown(sec) mmc_spindown(sec)
+ #define storage_spin() mmc_spin()
#define storage_enable(on) mmc_enable(on)
#define storage_sleepnow() mmc_sleepnow()
@@ -232,8 +232,8 @@ static inline void storage_sleep(void) {}
#define storage_driver_type(drive) (STORAGE_MMC_NUM)
#elif (CONFIG_STORAGE & STORAGE_NAND)
#define STORAGE_FUNCTION(NAME) (nand_## NAME)
- #define storage_spindown nand_spindown
- #define storage_spin nand_spin
+ #define storage_spindown(sec) nand_spindown(sec)
+ #define storage_spin() nand_spin()
#define storage_enable(on) (void)0
#define storage_sleepnow() nand_sleepnow()
@@ -256,8 +256,8 @@ static inline void storage_sleep(void) {}
#define storage_driver_type(drive) (STORAGE_NAND_NUM)
#elif (CONFIG_STORAGE & STORAGE_RAMDISK)
#define STORAGE_FUNCTION(NAME) (ramdisk_## NAME)
- #define storage_spindown ramdisk_spindown
- #define storage_spin ramdisk_spin
+ #define storage_spindown(sec) ramdisk_spindown(sec)
+ #define storage_spin() ramdisk_spin()
#define storage_enable(on) (void)0
#define storage_sleepnow() ramdisk_sleepnow()
@@ -284,6 +284,7 @@ static inline void storage_sleep(void) {}
#else /* CONFIG_STORAGE_MULTI || !HAVE_HOSTFS */
/* Multi-driver use normal functions */
+#define STORAGE_FUNCTION(NAME) (storage_## NAME)
void storage_enable(bool on);
void storage_sleepnow(void);