Skip to content

Commit

Permalink
leds: leds-pwm: return proper error if pwm_request failed
Browse files Browse the repository at this point in the history
Return PTR_ERR(led_dat->pwm) instead of 0 if pwm_request failed

Signed-off-by: Axel 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Axel Lin authored and Linus Torvalds committed Jan 26, 2011
1 parent f95ba94 commit d8cc667
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/leds/leds-pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d8cc667

Please sign in to comment.