Skip to contentSkip to conversation

pwm: pwm-mxs: Check the return value from stmp_reset_block()

PATCH Applied Fabio Estevam 2 participants 2 messages Jul 10, 2013 – Jul 29, 2013

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 pwm: pwm-mxs: Check the return value from stmp_reset_block()

From: Fabio Estevam <[email protected]>

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

---
 drivers/pwm/pwm-mxs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/pwm/pwm-mxs.c +7 -1
index 2c77b81..c2c5a4f 100644
@@ -161,9 +161,15 @@ static int mxs_pwm_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mxs);
 
-	stmp_reset_block(mxs->base);
+	ret = stmp_reset_block(mxs->base);
+	if (ret)
+		goto pwm_remove;
 
 	return 0;
+
+pwm_remove:
+	pwmchip_remove(&mxs->chip);
+	return ret;
 }
 
 static int mxs_pwm_remove(struct platform_device *pdev)
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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

---
 drivers/pwm/pwm-mxs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry