]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/rtc/rtc-mxc.c: check the return value from clk_prepare_enable()
authorFabio Estevam <fabio.estevam@freescale.com>
Fri, 3 Jan 2014 03:10:21 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:21 +0000 (14:10 +1100)
clk_prepare_enable() may fail, so let's check its return value and
propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-mxc.c

index a3ed1cf935ba28fc77008f958383a1a4c4f59ce5..419874fefa4b977ed205fd1aee50c808c1866cf5 100644 (file)
@@ -394,7 +394,10 @@ static int mxc_rtc_probe(struct platform_device *pdev)
                return PTR_ERR(pdata->clk);
        }
 
-       clk_prepare_enable(pdata->clk);
+       ret = clk_prepare_enable(pdata->clk);
+       if (ret)
+               return ret;
+
        rate = clk_get_rate(pdata->clk);
 
        if (rate == 32768)