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>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user