summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-pwm.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-01-25 15:07:14 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-26 10:49:58 +1000
commitd8cc667be8fad9ad0bb3a95116be9f80a3b3efcf (patch)
treeb7cd54ac64552d8ce1ffcfdb9caa567ca04bd9a2 /drivers/leds/leds-pwm.c
parentf95ba941d1bee594d536cdcbf879a0865381b903 (diff)
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 <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>
Diffstat (limited to 'drivers/leds/leds-pwm.c')
-rw-r--r--drivers/leds/leds-pwm.c1
1 files changed, 1 insertions, 0 deletions
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;