Commit 203bb5af authored by Ulf Hansson's avatar Ulf Hansson Committed by 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: default avatarUlf Hansson <ulf.hansson@linaro.org>
Reported-by: default avatarStephen Warren <swarren@wwwdotorg.org>
Reported-by: default avatarTuomas Tynkkynen <ttynkkynen@nvidia.com>
Tested-by: default avatarTuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment