Merge tag 'pinctrl-v3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[cascardo/linux.git] / drivers / mmc / host / sdhci-s3c.c
index 0ce6eb1..c45b893 100644 (file)
@@ -300,6 +300,7 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
        struct device *dev = &ourhost->pdev->dev;
        unsigned long timeout;
        u16 clk = 0;
+       int ret;
 
        host->mmc->actual_clock = 0;
 
@@ -311,7 +312,12 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
 
        sdhci_s3c_set_clock(host, clock);
 
-       clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
+       ret = clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
+       if (ret != 0) {
+               dev_err(dev, "%s: failed to set clock rate %uHz\n",
+                       mmc_hostname(host->mmc), clock);
+               return;
+       }
 
        clk = SDHCI_CLOCK_INT_EN;
        sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
@@ -609,7 +615,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
                goto err_req_regs;
        }
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
        if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
                clk_disable_unprepare(sc->clk_io);
 #endif
@@ -635,7 +641,7 @@ static int sdhci_s3c_remove(struct platform_device *pdev)
        if (sc->ext_cd_irq)
                free_irq(sc->ext_cd_irq, sc);
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
        if (sc->pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
                clk_prepare_enable(sc->clk_io);
 #endif
@@ -667,7 +673,7 @@ static int sdhci_s3c_resume(struct device *dev)
 }
 #endif
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 static int sdhci_s3c_runtime_suspend(struct device *dev)
 {
        struct sdhci_host *host = dev_get_drvdata(dev);