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

Fabio Estevam festevam at gmail.com
Sun Dec 1 21:50:02 EST 2013


From: Fabio Estevam <fabio.estevam at freescale.com>

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>
---
 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 9dfdb06..0c09b8b 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1512,7 +1512,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;
 
 	/*
-- 
1.8.1.2




More information about the linux-mtd mailing list