From: Axel Lin Date: Tue, 25 Jan 2011 23:07:14 +0000 (-0800) Subject: leds: leds-pwm: return proper error if pwm_request failed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d8cc667be8fad9ad0bb3a95116be9f80a3b3efcf;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git leds: leds-pwm: return proper error if pwm_request failed Return PTR_ERR(led_dat->pwm) instead of 0 if pwm_request failed Signed-off-by: Axel Lin Cc: Richard Purdie Cc: Luotao Fu Cc: Reviewed-by: Dmitry Torokhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index da3fa8dcdf5b..666daf77872e 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -69,6 +69,7 @@ static int led_pwm_probe(struct platform_device *pdev) led_dat->pwm = pwm_request(cur_led->pwm_id, cur_led->name); if (IS_ERR(led_dat->pwm)) { + ret = PTR_ERR(led_dat->pwm); dev_err(&pdev->dev, "unable to request PWM %d\n", cur_led->pwm_id); goto err;