mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
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>
This commit is contained in:
parent
257462dbf3
commit
5b1e8e0653
@ -220,7 +220,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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user