mtd: nand: mxc_nand: Check the return value from clk_prepare_enable()
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 2 Dec 2013 02:50:02 +0000 (00:50 -0200)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 3 Jan 2014 19:22:21 +0000 (11:22 -0800)
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: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/mxc_nand.c

index a4bad1165c2a08657aa037363924e7ed23a8f0f9..7a4e032f6c7cb17c0b7514fc7d2b3f8d49198e8d 100644 (file)
@@ -1511,7 +1511,9 @@ static int mxcnd_probe(struct platform_device *pdev)
        if (err)
                return err;
 
-       clk_prepare_enable(host->clk);
+       err = clk_prepare_enable(host->clk);
+       if (err)
+               return err;
        host->clk_act = 1;
 
        /*