提交 5b1e8e06 编写于 作者: B Beniamino Galvani 提交者: Thierry Reding

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: NBeniamino Galvani <b.galvani@gmail.com>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 257462db
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册