From 5b1e8e0653760ade53c0c7caaa9278c57361cb8b Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 5 May 2014 23:29:00 +0200 Subject: 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 Acked-by: Viresh Kumar Signed-off-by: Thierry Reding --- drivers/pwm/pwm-spear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pwm') diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c index b4f6d0df5f2d..cffa1e390320 100644 --- a/drivers/pwm/pwm-spear.c +++ b/drivers/pwm/pwm-spear.c @@ -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); } -- cgit v1.2.3-58-ga151