Skip to content

Commit

Permalink
mmc: core: Fixup Oops for SDIO shutdown
Browse files Browse the repository at this point in the history
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: Ulf Hansson <ulf.hansson@linaro.org>
Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reported-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Tested-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Ulf Hansson authored and Chris Ball committed Jul 5, 2013
1 parent 30d025c commit 203bb5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/core/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 203bb5a

Please sign in to comment.