mtd: nand: pxa3xx: Check for clk_prepare_enable() return value

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:03 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=1f8eaff2aa75f8ec662e044deecdc91abc780d60
Commit:     1f8eaff2aa75f8ec662e044deecdc91abc780d60
Parent:     fb32061ffaa9da61f72f79120a39729aa1736de0
Author:     Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
AuthorDate: Wed Apr 17 13:38:13 2013 -0300
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 20:47:48 2013 +0100

    mtd: nand: pxa3xx: Check for clk_prepare_enable() return value
    
    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 at free-electrons.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 1c03f9c..0f820ca 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -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



More information about the linux-mtd-cvs mailing list