mmc: core: Handle card shutdown from mmc_bus
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 10 Jun 2013 15:03:40 +0000 (17:03 +0200)
committerlintao <lintao@rock-chips.com>
Fri, 7 Mar 2014 11:52:34 +0000 (19:52 +0800)
Considering shutdown of the card, the responsibility to initate this
sequence shall be driven from the mmc_bus.

This patch enables the mmc_bus to handle this sequence properly. A new
.shutdown callback is added in the mmc_driver struct which is used to
shutdown the blk device.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Conflicts:
drivers/mmc/core/bus.c

drivers/mmc/core/bus.c

index cdca8a70da38bfcc9cace78dde9afe563afaef24..42c1bbc47daa6328e622eba2857f0053585b3e38 100644 (file)
@@ -126,18 +126,8 @@ static void mmc_bus_shutdown(struct device *dev)
 {
        struct mmc_driver *drv = to_mmc_driver(dev->driver);
        struct mmc_card *card = mmc_dev_to_card(dev);
-       struct mmc_host *host = card->host;
-       int ret;
-
-       if (dev->driver && drv->shutdown)
-               drv->shutdown(card);
 
-       if (host->bus_ops->shutdown) {
-               ret = host->bus_ops->shutdown(host);
-               if (ret)
-                       pr_warn("%s: error %d during shutdown\n",
-                               mmc_hostname(host), ret);
-       }
+       drv->shutdown(card);
 }
 
 #ifdef CONFIG_PM_SLEEP