memory: ti-aemif: Handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 31 May 2017 10:25:54 +0000 (15:55 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Jun 2017 10:08:14 +0000 (19:08 +0900)
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/memory/ti-aemif.c

index 22c1aeeb64215d855613422b7a075c2e8a5458bb..2744b1b91b57c09ce1278d6e3cef158e09a99ca0 100644 (file)
@@ -357,7 +357,10 @@ static int aemif_probe(struct platform_device *pdev)
                return PTR_ERR(aemif->clk);
        }
 
-       clk_prepare_enable(aemif->clk);
+       ret = clk_prepare_enable(aemif->clk);
+       if (ret)
+               return ret;
+
        aemif->clk_rate = clk_get_rate(aemif->clk) / MSEC_PER_SEC;
 
        if (of_device_is_compatible(np, "ti,da850-aemif"))