]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP: HSMMC: Check wether board specific suspend / resume exists
authorHögander Jouni <jouni.hogander@nokia.com>
Mon, 18 Aug 2008 15:13:15 +0000 (18:13 +0300)
committerTony Lindgren <tony@atomide.com>
Wed, 10 Sep 2008 23:59:41 +0000 (16:59 -0700)
Do not try to call board specific suspend / resume functions if there
is no such.

Signed-off-by: Jouni Högander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mmc/host/omap_hsmmc.c

index af3487164a96d1856e1f6c3c56995cfc0f0b2666..9462e4c34b2c40705065d2fef8e61cf67cce19f3 100644 (file)
@@ -960,11 +960,13 @@ static int omap_mmc_suspend(struct platform_device *pdev, pm_message_t state)
                        OMAP_HSMMC_WRITE(host->base, ISE, 0);
                        OMAP_HSMMC_WRITE(host->base, IE, 0);
 
-                       ret = host->pdata->suspend(&pdev->dev, host->slot_id);
-                       if (ret)
-                               dev_dbg(mmc_dev(host->mmc),
-                                       "Unable to handle MMC board"
-                                       " level suspend\n");
+                       if (host->pdata->suspend) {
+                               ret = host->pdata->suspend(&pdev->dev, host->slot_id);
+                               if (ret)
+                                       dev_dbg(mmc_dev(host->mmc),
+                                               "Unable to handle MMC board"
+                                               " level suspend\n");
+                       }
 
                        if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) {
                                OMAP_HSMMC_WRITE(host->base, HCTL,
@@ -1013,10 +1015,12 @@ static int omap_mmc_resume(struct platform_device *pdev)
                        dev_dbg(mmc_dev(host->mmc),
                                        "Enabling debounce clk failed\n");
 
-               ret = host->pdata->resume(&pdev->dev, host->slot_id);
-               if (ret)
-                       dev_dbg(mmc_dev(host->mmc),
+               if (host->pdata->resume) {
+                       ret = host->pdata->resume(&pdev->dev, host->slot_id);
+                       if (ret)
+                               dev_dbg(mmc_dev(host->mmc),
                                        "Unmask interrupt failed\n");
+               }
 
                /* Notify the core to resume the host */
                ret = mmc_resume_host(host->mmc);