[PATCH v2 15/20] mmc: sdio: verify existence of resume handler

Ohad Ben-Cohen ohad at wizery.com
Wed Jul 21 13:33:49 EDT 2010


Before invoking a card's resume handler, verify one exists.

Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
---
 drivers/mmc/core/sdio.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 645f173..37739f5 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -504,7 +504,9 @@ static int mmc_sdio_resume(struct mmc_host *host)
 		struct sdio_func *func = host->card->sdio_func[i];
 		if (func && sdio_func_present(func) && func->dev.driver) {
 			const struct dev_pm_ops *pmops = func->dev.driver->pm;
-			err = pmops->resume(&func->dev);
+
+			if (pmops && pmops->resume)
+				err = pmops->resume(&func->dev);
 		}
 	}
 
-- 
1.7.0.4




More information about the linux-arm-kernel mailing list