diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-10-30 01:00:18 +0100 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-02-13 22:58:15 -0500 |
commit | 2501c9179dff2add6aadd3898cd729e94e777d3a (patch) | |
tree | 5ec2c6fc9d62b21920b7319fbf14e22cad467f6b /drivers/mmc/core/sd.c | |
parent | 710dec95d579bf59c157358cc9cf7b42907d1c0f (diff) |
mmc: core: Use MMC_UNSAFE_RESUME as default behavior
Invoking system suspend or shutdown without using the Kconfig option
MMC_UNSAFE_RESUME, did trigger an ungraceful power cut of the card.
To improve the situation, change the behavior to always make use of the
available bus_ops callbacks that handles system suspend and shutdown
properly.
By changing the behavior MMC_UNSAFE_RESUME becomes redundant, so lets's
remove it.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/core/sd.c')
-rw-r--r-- | drivers/mmc/core/sd.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 692fdb17729..2dd359d2242 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1209,16 +1209,6 @@ static int mmc_sd_power_restore(struct mmc_host *host) static const struct mmc_bus_ops mmc_sd_ops = { .remove = mmc_sd_remove, .detect = mmc_sd_detect, - .suspend = NULL, - .resume = NULL, - .power_restore = mmc_sd_power_restore, - .alive = mmc_sd_alive, - .shutdown = mmc_sd_suspend, -}; - -static const struct mmc_bus_ops mmc_sd_ops_unsafe = { - .remove = mmc_sd_remove, - .detect = mmc_sd_detect, .runtime_suspend = mmc_sd_runtime_suspend, .runtime_resume = mmc_sd_runtime_resume, .suspend = mmc_sd_suspend, @@ -1228,17 +1218,6 @@ static const struct mmc_bus_ops mmc_sd_ops_unsafe = { .shutdown = mmc_sd_suspend, }; -static void mmc_sd_attach_bus_ops(struct mmc_host *host) -{ - const struct mmc_bus_ops *bus_ops; - - if (!mmc_card_is_removable(host)) - bus_ops = &mmc_sd_ops_unsafe; - else - bus_ops = &mmc_sd_ops; - mmc_attach_bus(host, bus_ops); -} - /* * Starting point for SD card init. */ @@ -1254,7 +1233,7 @@ int mmc_attach_sd(struct mmc_host *host) if (err) return err; - mmc_sd_attach_bus_ops(host); + mmc_attach_bus(host, &mmc_sd_ops); if (host->ocr_avail_sd) host->ocr_avail = host->ocr_avail_sd; |