aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-04-28 11:30:50 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-05-01 07:04:18 -0400
commitb5af25bee2de2f6cd1ac74ba737cbc4f3d303e5d (patch)
treeac3659c18e19c3b487806b5ca468fe8e8826f9f2 /drivers/mmc/mmc.c
parentd2b46f66b4b342be07a4194bd5e82384d07e470d (diff)
mmc: remove card upon suspend
Suspending MMC/SD cards (versus removing and readding them) is an inherently unsafe operation and has even been broken for some time. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 0242c6a21daf..94c04725726d 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1738,10 +1738,17 @@ EXPORT_SYMBOL(mmc_free_host);
1738 */ 1738 */
1739int mmc_suspend_host(struct mmc_host *host, pm_message_t state) 1739int mmc_suspend_host(struct mmc_host *host, pm_message_t state)
1740{ 1740{
1741 mmc_claim_host(host); 1741 struct list_head *l, *n;
1742 mmc_deselect_cards(host); 1742
1743 mmc_flush_scheduled_work();
1744
1745 list_for_each_safe(l, n, &host->cards) {
1746 struct mmc_card *card = mmc_list_to_card(l);
1747
1748 mmc_remove_card(card);
1749 }
1750
1743 mmc_power_off(host); 1751 mmc_power_off(host);
1744 mmc_release_host(host);
1745 1752
1746 return 0; 1753 return 0;
1747} 1754}