pwm: spear: fix check on pwmchip_add() return value
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>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index b4f6d0d..cffa1e3 100644
--- a/drivers/pwm/pwm-spear.c
+++ b/drivers/pwm/pwm-spear.c
@@ -220,7 +220,7 @@
}
ret = pwmchip_add(&pc->chip);
- if (!ret) {
+ if (ret < 0) {
clk_unprepare(pc->clk);
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
}