Skip to content

Commit

Permalink
pwm: spear: fix check on pwmchip_add() return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Beniamino Galvani authored and Thierry Reding committed May 7, 2014
1 parent 257462d commit 5b1e8e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-spear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5b1e8e0

Please sign in to comment.