From 7ff78c4ccb4d4715778a2f7cea0fd9555f0d6eab Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 30 Aug 2012 17:25:25 +0200 Subject: [PATCH] imx233: fix compilation of sdmmc for non-mmc targets Change-Id: I0f61d0ca8e385fbfeaba53b81c3320b24aa61ab9 --- firmware/target/arm/imx233/sdmmc-imx233.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c index a41a549e02..e0966f784b 100644 --- a/firmware/target/arm/imx233/sdmmc-imx233.c +++ b/firmware/target/arm/imx233/sdmmc-imx233.c @@ -647,6 +647,7 @@ static void sdmmc_thread(void) { struct queue_event ev; bool idle_notified = false; + int timeout = 0; while (1) { @@ -706,8 +707,13 @@ static void sdmmc_thread(void) } #endif case SYS_TIMEOUT: - if(TIME_BEFORE(current_tick, sd_last_disk_activity()+(3*HZ)) || - TIME_BEFORE(current_tick, mmc_last_disk_activity()+(3*HZ))) +#if CONFIG_STORAGE & STORAGE_SD + timeout = MAX(timeout, sd_last_disk_activity()+(3*HZ)); +#endif +#if CONFIG_STORAGE & STORAGE_MMC + timeout = MAX(timeout, mmc_last_disk_activity()+(3*HZ)); +#endif + if(TIME_BEFORE(current_tick, timeout)) { idle_notified = false; }