提交 203bb5af 编写于 作者: U Ulf Hansson 提交者: Chris Ball

mmc: core: Fixup Oops for SDIO shutdown

Commit "mmc: core: Handle card shutdown from mmc_bus" introduced an
Oops in the shutdown sequence for SDIO.

The drv pointer, does not exist for SDIO since the probing of the SDIO
card from the mmc_bus perspective is expected to fail by returning
-ENODEV.

This patch adds the proper check for the pointer before calling it.
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Reported-by: NStephen Warren <swarren@wwwdotorg.org>
Reported-by: NTuomas Tynkkynen <ttynkkynen@nvidia.com>
Tested-by: NTuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: NJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 30d025c0
......@@ -129,7 +129,8 @@ static void mmc_bus_shutdown(struct device *dev)
struct mmc_host *host = card->host;
int ret;
drv->shutdown(card);
if (dev->driver && drv->shutdown)
drv->shutdown(card);
if (host->bus_ops->shutdown) {
ret = host->bus_ops->shutdown(host);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册