From: David Anders Date: Thu, 7 Oct 2010 19:36:29 +0000 (+0000) Subject: omap4: pandaboard: Fix the init if CONFIG_MMC_OMAP_HS is not set X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=b9b52620823f84f95f3fd94dd6769b7102d7888a;p=deliverable%2Flinux.git omap4: pandaboard: Fix the init if CONFIG_MMC_OMAP_HS is not set Avoid possible crash if CONFIG_MMC_OMAP_HS is not set. Signed-off-by: David Anders Signed-off-by: Anand Gadiyar Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index d8c70c13953a..e9c6b24361bc 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -116,7 +116,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev) static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) { - struct omap_mmc_platform_data *pdata = dev->platform_data; + struct omap_mmc_platform_data *pdata; + + /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ + if (!dev) { + pr_err("Failed omap4_twl6030_hsmmc_set_late_init\n"); + return; + } + pdata = dev->platform_data; pdata->init = omap4_twl6030_hsmmc_late_init; }