diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-06-10 17:03:40 +0200 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-06-27 12:39:18 -0400 |
commit | 7628774851751e55362ec7d9d57c9334e656a655 (patch) | |
tree | 54a8d24423250ceec0fd3468aeef20465941085a /drivers/mmc/core | |
parent | 986892ca78eeddd9d6b629050fea432979ddd321 (diff) |
mmc: core: Handle card shutdown from mmc_bus
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>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/bus.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 3b7ca8ac0e61..219bf4b1d97e 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -122,6 +122,14 @@ static int mmc_bus_remove(struct device *dev) return 0; } +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); + + drv->shutdown(card); +} + #ifdef CONFIG_PM_SLEEP static int mmc_bus_suspend(struct device *dev) { @@ -205,6 +213,7 @@ static struct bus_type mmc_bus_type = { .uevent = mmc_bus_uevent, .probe = mmc_bus_probe, .remove = mmc_bus_remove, + .shutdown = mmc_bus_shutdown, .pm = &mmc_bus_pm_ops, }; |