Skip to contentSkip to conversation

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

PATCH Applied Fabio Estevam 2 participants 2 messages Dec 2, 2013 – Dec 4, 2013

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

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

From: Fabio Estevam <[email protected]>

clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error.

---
 drivers/mtd/nand/mxc_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/nand/mxc_nand.c +3 -1
index 9dfdb06..0c09b8b 100644
@@ -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;
 
 	/*
Signature · 1 line
1.8.1.2