mmc: au1xmmc: fix error return code in au1xmmc_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 14 Aug 2014 01:00:19 +0000 (09:00 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 9 Sep 2014 11:59:01 +0000 (13:59 +0200)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/au1xmmc.c

index 9c9f6af..725f6a6 100644 (file)
@@ -1028,9 +1028,12 @@ static int au1xmmc_probe(struct platform_device *pdev)
        host->clk = clk_get(&pdev->dev, ALCHEMY_PERIPH_CLK);
        if (IS_ERR(host->clk)) {
                dev_err(&pdev->dev, "cannot find clock\n");
+               ret = PTR_ERR(host->clk);
                goto out_irq;
        }
-       if (clk_prepare_enable(host->clk)) {
+
+       ret = clk_prepare_enable(host->clk);
+       if (ret) {
                dev_err(&pdev->dev, "cannot enable clock\n");
                goto out_clk;
        }