lkml.org 
[lkml]   [2011]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] leds: leds-pwm: return proper error if pwm_request failed
On Thu, Jan 20, 2011 at 11:38:55AM +0800, Axel Lin wrote:
> Return PTR_ERR(led_dat->pwm) instead of 0 if pwm_request failed
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Looks good.

Reviewed-by: Dmitry Torokhov <dtor@mail.ru>

> ---
> drivers/leds/leds-pwm.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
> index da3fa8d..666daf7 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;

--
Dmitry


\
 
 \ /
  Last update: 2011-01-20 09:25    [W:0.031 / U:50.148 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site