arm: omap4: hsmmc: check for null pointer master new_branch
authorBalaji T K <balajitk@ti.com>
Tue, 3 Apr 2012 09:48:28 +0000 (15:18 +0530)
committerBalaji T K <balajitk@ti.com>
Tue, 3 Apr 2012 09:48:28 +0000 (15:18 +0530)
commit66c1b19955283c4b591601e4e9a1eb3a1331d56e
treeda91d34481887f878eb278e115e20dd3199503ad
parenta4dfa827bb5b9a984d4000ffb80134b9495e4d8a
arm: omap4: hsmmc: check for null pointer

platform_device pdev can be NULL if CONFIG_MMC_OMAP_HS is not set
Check for NULL pointer

Fixes the following boot crash seen with omap4sdp and omap4panda
when MMC is disabled.

Unable to handle kernel NULL pointer dereference at virtual address 0000008c
pgd = c0004000
[0000008c] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in:
CPU: 0    Not tainted  (3.4.0-rc1-05971-ga4dfa82 #4)
PC is at omap_4430sdp_init+0x184/0x410
LR is at device_add+0x1a0/0x664

Signed-off-by: Balaji T K <balajitk@ti.com>
Reported-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-omap4panda.c