mmc: mxs-mmc: Check for clk_prepare_enable() error
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 19 Nov 2014 13:16:59 +0000 (11:16 -0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 26 Nov 2014 13:31:04 +0000 (14:31 +0100)
clk_prepare_enable() may fail and in this case we should propagate the error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mxs-mmc.c

index f2c49e0e213dc838ace54b5d97e12e1476f75ffd..60c4ca97a727785bb5dcfbd292a023d04cd3b5d0 100644 (file)
@@ -619,7 +619,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
                ret = PTR_ERR(ssp->clk);
                goto out_mmc_free;
        }
-       clk_prepare_enable(ssp->clk);
+       ret = clk_prepare_enable(ssp->clk);
+       if (ret)
+               goto out_mmc_free;
 
        ret = mxs_mmc_reset(host);
        if (ret) {
@@ -719,8 +721,7 @@ static int mxs_mmc_resume(struct device *dev)
        struct mxs_mmc_host *host = mmc_priv(mmc);
        struct mxs_ssp *ssp = &host->ssp;
 
-       clk_prepare_enable(ssp->clk);
-       return 0;
+       return clk_prepare_enable(ssp->clk);
 }
 #endif