linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: spear: fix check on pwmchip_add() return value
@ 2014-05-05 21:29 Beniamino Galvani
  2014-05-07  6:07 ` Viresh Kumar
  0 siblings, 1 reply; 6+ messages in thread
From: Beniamino Galvani @ 2014-05-05 21:29 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-pwm, linux-kernel, Beniamino Galvani

pwmchip_add() returns zero on success and a negative value on error,
so the condition of the check must be inverted.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
---
 drivers/pwm/pwm-spear.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index cb2d4f0..945556d 100644
--- a/drivers/pwm/pwm-spear.c
+++ b/drivers/pwm/pwm-spear.c
@@ -222,7 +222,7 @@ static int spear_pwm_probe(struct platform_device *pdev)
 	}
 
 	ret = pwmchip_add(&pc->chip);
-	if (!ret) {
+	if (ret < 0) {
 		clk_unprepare(pc->clk);
 		dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
 	}
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-07  8:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-05 21:29 [PATCH] pwm: spear: fix check on pwmchip_add() return value Beniamino Galvani
2014-05-07  6:07 ` Viresh Kumar
2014-05-07  8:24   ` Thierry Reding
2014-05-07  8:32     ` Viresh Kumar
2014-05-07  8:49       ` Thierry Reding
2014-05-07  8:53         ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).