Re: [PATCH] leds: leds-pwm: return proper error if pwm_request failed

From: Dmitry Torokhov
Date: Thu Jan 20 2011 - 03:22:24 EST


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@xxxxxxxxx>

Looks good.

Reviewed-by: Dmitry Torokhov <dtor@xxxxxxx>

> ---
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/