]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Check the get_cover_state function pointer if not set
authorKyungmin Park <kyungmin.park@samsung.com>
Thu, 29 Nov 2007 08:01:11 +0000 (17:01 +0900)
committerTony Lindgren <tony@atomide.com>
Sat, 1 Dec 2007 00:05:08 +0000 (16:05 -0800)
If the get_cover_state is not set, it occurs the oops.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mmc/host/omap.c

index cf9d31ce51c2a412cc4519b0f59f67251c2235bf..d7ececeb0d0621cbfe0a1d8d3fbce1a58619a731 100644 (file)
@@ -238,7 +238,9 @@ static void mmc_omap_release_slot(struct mmc_omap_slot *slot)
 static inline
 int mmc_omap_cover_is_open(struct mmc_omap_slot *slot)
 {
-       return slot->pdata->get_cover_state(mmc_dev(slot->mmc), slot->id);
+       if (slot->pdata->get_cover_state)
+               return slot->pdata->get_cover_state(mmc_dev(slot->mmc), slot->id);
+       return 0;
 }
 
 static ssize_t