From d8cc667be8fad9ad0bb3a95116be9f80a3b3efcf Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 25 Jan 2011 15:07:14 -0800 Subject: [PATCH] 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 --- drivers/leds/leds-pwm.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.20.1