aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 0a117c61cd18..ceae379a4d4c 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1079,13 +1079,17 @@ static void mmc_setup(struct mmc_host *host)
1079/** 1079/**
1080 * mmc_detect_change - process change of state on a MMC socket 1080 * mmc_detect_change - process change of state on a MMC socket
1081 * @host: host which changed state. 1081 * @host: host which changed state.
1082 * @delay: optional delay to wait before detection (jiffies)
1082 * 1083 *
1083 * All we know is that card(s) have been inserted or removed 1084 * All we know is that card(s) have been inserted or removed
1084 * from the socket(s). We don't know which socket or cards. 1085 * from the socket(s). We don't know which socket or cards.
1085 */ 1086 */
1086void mmc_detect_change(struct mmc_host *host) 1087void mmc_detect_change(struct mmc_host *host, unsigned long delay)
1087{ 1088{
1088 schedule_work(&host->detect); 1089 if (delay)
1090 schedule_delayed_work(&host->detect, delay);
1091 else
1092 schedule_work(&host->detect);
1089} 1093}
1090 1094
1091EXPORT_SYMBOL(mmc_detect_change); 1095EXPORT_SYMBOL(mmc_detect_change);
@@ -1189,7 +1193,7 @@ int mmc_add_host(struct mmc_host *host)
1189 ret = mmc_add_host_sysfs(host); 1193 ret = mmc_add_host_sysfs(host);
1190 if (ret == 0) { 1194 if (ret == 0) {
1191 mmc_power_off(host); 1195 mmc_power_off(host);
1192 mmc_detect_change(host); 1196 mmc_detect_change(host, 0);
1193 } 1197 }
1194 1198
1195 return ret; 1199 return ret;
@@ -1259,7 +1263,7 @@ EXPORT_SYMBOL(mmc_suspend_host);
1259 */ 1263 */
1260int mmc_resume_host(struct mmc_host *host) 1264int mmc_resume_host(struct mmc_host *host)
1261{ 1265{
1262 mmc_detect_change(host); 1266 mmc_detect_change(host, 0);
1263 1267
1264 return 0; 1268 return 0;
1265} 1269}