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 <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
Beniamino Galvani 2014-05-05 23:29:00 +02:00 • committed by Thierry Reding
commit 5b1e8e0653

View file

@ -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);
}