mmc: sdhci-bcm-kona: fix error return code in sdhci_bcm_kona_probe()
authorWei Yongjun <weiyj.lk@gmail.com>
Thu, 28 Jul 2016 16:17:44 +0000 (16:17 +0000)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 26 Sep 2016 19:31:08 +0000 (21:31 +0200)
In clk_set_rate() or clk_prepare_enable() error handling case, the
error return code ret is not set, so sdhci_bcm_kona_probe() return
0 in those error cases.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-bcm-kona.c

index e5c634bdfdd909f20b6468c9fefc5b6ecca909c7..51dd2fd65000c966a89b8dc7d8263de939695e13 100644 (file)
@@ -253,12 +253,14 @@ static int sdhci_bcm_kona_probe(struct platform_device *pdev)
                goto err_pltfm_free;
        }
 
-       if (clk_set_rate(pltfm_priv->clk, host->mmc->f_max) != 0) {
+       ret = clk_set_rate(pltfm_priv->clk, host->mmc->f_max);
+       if (ret) {
                dev_err(dev, "Failed to set rate core clock\n");
                goto err_pltfm_free;
        }
 
-       if (clk_prepare_enable(pltfm_priv->clk) != 0) {
+       ret = clk_prepare_enable(pltfm_priv->clk);
+       if (ret) {
                dev_err(dev, "Failed to enable core clock\n");
                goto err_pltfm_free;
        }