LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] leds: leds-pwm: return proper error if pwm_request failed
@ 2011-01-20  3:38 Axel Lin
  2011-01-20  8:22 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2011-01-20  3:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Richard Purdie, Luotao Fu, Andrew Morton

Return PTR_ERR(led_dat->pwm) instead of 0 if pwm_request failed

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 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;
-- 
1.7.2




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] leds: leds-pwm: return proper error if pwm_request failed
  2011-01-20  3:38 [PATCH] leds: leds-pwm: return proper error if pwm_request failed Axel Lin
@ 2011-01-20  8:22 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2011-01-20  8:22 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Richard Purdie, Luotao Fu, Andrew Morton

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-20  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-20  3:38 [PATCH] leds: leds-pwm: return proper error if pwm_request failed Axel Lin
2011-01-20  8:22 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).