diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 42c1bbc47daa..37b4be81e530 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -126,8 +126,19 @@ 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