summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/sdmmc-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-10-02 16:51:28 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-10-21 01:23:13 +0200
commit187017bad1c5192c50019a15952f7dd9f36eb3e5 (patch)
tree2e2a554ddcd4eff9fc94d63bb60eccbf26727360 /firmware/target/arm/imx233/sdmmc-imx233.c
parent5b3eaf6f5bb9d0db0816f044323728349fadf6dd (diff)
downloadrockbox-187017bad1c5192c50019a15952f7dd9f36eb3e5.tar.gz
rockbox-187017bad1c5192c50019a15952f7dd9f36eb3e5.tar.bz2
rockbox-187017bad1c5192c50019a15952f7dd9f36eb3e5.zip
imx233: simplify sd/mmc code
Change-Id: I7e36b4c1c91540a2ae383109e440818bc610dde6
Diffstat (limited to 'firmware/target/arm/imx233/sdmmc-imx233.c')
-rw-r--r--firmware/target/arm/imx233/sdmmc-imx233.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c
index c81220166d..a4329b1416 100644
--- a/firmware/target/arm/imx233/sdmmc-imx233.c
+++ b/firmware/target/arm/imx233/sdmmc-imx233.c
@@ -190,19 +190,19 @@ static int init_drive(int drive);
* refer to sd/mmc drive indexes. We keep two maps sd->sdmmc and mmc->sdmmc
* to find the sdmmc index from the sd or mmc one */
+static inline int sdmmc_removable(int drive)
+{
+ return SDMMC_FLAGS(drive) & REMOVABLE;
+}
+
static int sdmmc_present(int drive)
{
- if(SDMMC_FLAGS(drive) & REMOVABLE)
+ if(sdmmc_removable(drive))
return imx233_ssp_sdmmc_detect(SDMMC_SSP(drive));
else
return true;
}
-static inline int sdmmc_removable(int drive)
-{
- return SDMMC_FLAGS(drive) & REMOVABLE;
-}
-
static void sdmmc_detect_callback(int ssp)
{
/* This is called only if the state was stable for 300ms - check state
@@ -790,7 +790,7 @@ static int sdmmc_init(void)
for(unsigned drive = 0; drive < SDMMC_NUM_DRIVES; drive++)
{
- if(SDMMC_FLAGS(drive) & REMOVABLE)
+ if(sdmmc_removable(drive))
imx233_ssp_sdmmc_setup_detect(SDMMC_SSP(drive), true, sdmmc_detect_callback,
false, SDMMC_FLAGS(drive) & DETECT_INVERTED);
}