mtd: nand: pxa3xx: Check for clk_prepare_enable() return value
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Wed, 17 Apr 2013 16:38:13 +0000 (13:38 -0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 5 Aug 2013 19:47:48 +0000 (20:47 +0100)
clk_prepare_enable() can fail due to unknown reason.
Add a check for this and return the error code if it fails.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/pxa3xx_nand.c

index 1c03f9c73f8dec0807091867229b309b5125065c..0f820caaa893967ff27c8f6d75b44185d83dc4d1 100644 (file)
@@ -1072,7 +1072,9 @@ static int alloc_nand_resource(struct platform_device *pdev)
                dev_err(&pdev->dev, "failed to get nand clock\n");
                return PTR_ERR(info->clk);
        }
-       clk_prepare_enable(info->clk);
+       ret = clk_prepare_enable(info->clk);
+       if (ret < 0)
+               return ret;
 
        /*
         * This is a dirty hack to make this driver work from devicetree