提交 6b086bde 编写于 作者: U Ulf Hansson 提交者: Chris Ball

mmc: core: Extend shutdown sequence to handle bus operations

By adding an optional .shutdown callback to the bus_ops struct we
provide the possibility to let each bus type handle it's shutdown
requirements.
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 76287748
...@@ -126,8 +126,17 @@ static void mmc_bus_shutdown(struct device *dev) ...@@ -126,8 +126,17 @@ static void mmc_bus_shutdown(struct device *dev)
{ {
struct mmc_driver *drv = to_mmc_driver(dev->driver); struct mmc_driver *drv = to_mmc_driver(dev->driver);
struct mmc_card *card = mmc_dev_to_card(dev); struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_host *host = card->host;
int ret;
drv->shutdown(card); 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);
}
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
......
...@@ -26,6 +26,7 @@ struct mmc_bus_ops { ...@@ -26,6 +26,7 @@ struct mmc_bus_ops {
int (*power_save)(struct mmc_host *); int (*power_save)(struct mmc_host *);
int (*power_restore)(struct mmc_host *); int (*power_restore)(struct mmc_host *);
int (*alive)(struct mmc_host *); int (*alive)(struct mmc_host *);
int (*shutdown)(struct mmc_host *);
}; };
void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops); void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册