diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-09-10 06:58:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-09-10 06:58:21 -0400 |
commit | c4a72cbdb39fd559988b16d118f7e5782935ff11 (patch) | |
tree | ddb9f7d19895498c19043dcc61cd79b8300aa214 /drivers/mmc | |
parent | 87fc767b832ef5a681a0ff9d203c3289bc3be2bf (diff) |
[MMC] Add mmc_detect_change() delay support for wbsd driver
Convert wbsd to use the new delay functionality in mmc_detect_change()
rather than implementing its own timer.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/wbsd.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index a62c86fef5cc..e11e55dc8924 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -1112,20 +1112,6 @@ static void wbsd_reset_ignore(unsigned long data) | |||
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | /* | 1114 | /* |
1115 | * Helper function for card detection | ||
1116 | */ | ||
1117 | static void wbsd_detect_card(unsigned long data) | ||
1118 | { | ||
1119 | struct wbsd_host *host = (struct wbsd_host*)data; | ||
1120 | |||
1121 | BUG_ON(host == NULL); | ||
1122 | |||
1123 | DBG("Executing card detection\n"); | ||
1124 | |||
1125 | mmc_detect_change(host->mmc, 0); | ||
1126 | } | ||
1127 | |||
1128 | /* | ||
1129 | * Tasklets | 1115 | * Tasklets |
1130 | */ | 1116 | */ |
1131 | 1117 | ||
@@ -1169,14 +1155,16 @@ static void wbsd_tasklet_card(unsigned long param) | |||
1169 | DBG("Card inserted\n"); | 1155 | DBG("Card inserted\n"); |
1170 | host->flags |= WBSD_FCARD_PRESENT; | 1156 | host->flags |= WBSD_FCARD_PRESENT; |
1171 | 1157 | ||
1158 | spin_unlock(&host->lock); | ||
1159 | |||
1172 | /* | 1160 | /* |
1173 | * Delay card detection to allow electrical connections | 1161 | * Delay card detection to allow electrical connections |
1174 | * to stabilise. | 1162 | * to stabilise. |
1175 | */ | 1163 | */ |
1176 | mod_timer(&host->detect_timer, jiffies + HZ/2); | 1164 | mmc_detect_change(host->mmc, msecs_to_jiffies(500)); |
1177 | } | 1165 | } |
1178 | 1166 | else | |
1179 | spin_unlock(&host->lock); | 1167 | spin_unlock(&host->lock); |
1180 | } | 1168 | } |
1181 | else if (host->flags & WBSD_FCARD_PRESENT) | 1169 | else if (host->flags & WBSD_FCARD_PRESENT) |
1182 | { | 1170 | { |
@@ -1409,10 +1397,6 @@ static int __devinit wbsd_alloc_mmc(struct device* dev) | |||
1409 | /* | 1397 | /* |
1410 | * Set up timers | 1398 | * Set up timers |
1411 | */ | 1399 | */ |
1412 | init_timer(&host->detect_timer); | ||
1413 | host->detect_timer.data = (unsigned long)host; | ||
1414 | host->detect_timer.function = wbsd_detect_card; | ||
1415 | |||
1416 | init_timer(&host->ignore_timer); | 1400 | init_timer(&host->ignore_timer); |
1417 | host->ignore_timer.data = (unsigned long)host; | 1401 | host->ignore_timer.data = (unsigned long)host; |
1418 | host->ignore_timer.function = wbsd_reset_ignore; | 1402 | host->ignore_timer.function = wbsd_reset_ignore; |
@@ -1454,7 +1438,6 @@ static void __devexit wbsd_free_mmc(struct device* dev) | |||
1454 | BUG_ON(host == NULL); | 1438 | BUG_ON(host == NULL); |
1455 | 1439 | ||
1456 | del_timer_sync(&host->ignore_timer); | 1440 | del_timer_sync(&host->ignore_timer); |
1457 | del_timer_sync(&host->detect_timer); | ||
1458 | 1441 | ||
1459 | mmc_free_host(mmc); | 1442 | mmc_free_host(mmc); |
1460 | 1443 | ||