mtd: nand: mxc_nand: Check the return value from clk_prepare_enable()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 28 00:59:03 EST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=dcedf628f55ccdb34c8783a03bed9382bb5e1a82
Commit:     dcedf628f55ccdb34c8783a03bed9382bb5e1a82
Parent:     0566477762f9e174e97af347ee9c865f908a5647
Author:     Fabio Estevam <fabio.estevam at freescale.com>
AuthorDate: Mon Dec 2 00:50:02 2013 -0200
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Jan 3 11:22:21 2014 -0800

    mtd: nand: mxc_nand: Check the return value from clk_prepare_enable()
    
    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 at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/mxc_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index a4bad11..7a4e032 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -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;
 
 	/*



More information about the linux-mtd-cvs mailing list