Skip to content
Snippets Groups Projects
Commit d8cc667b authored by Axel Lin's avatar Axel Lin Committed by Linus Torvalds
Browse files

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: default avatarAxel Lin <axel.lin@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Luotao Fu <l.fu@pengutronix.de>
Cc: Reviewed-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f95ba941
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment