All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: weiyj_lk@163.com
Cc: Richard Purdie <rpurdie@rpsys.net>,
	Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds: leds-gpio: Fix return value check in create_gpio_led()
Date: Mon, 08 Feb 2016 09:09:45 +0100	[thread overview]
Message-ID: <56B84D49.1030400@samsung.com> (raw)
In-Reply-To: <1454769453-9533-1-git-send-email-weiyj_lk@163.com>

Hi Wei,

On 02/06/2016 03:37 PM, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function gpio_to_desc() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value
> check should be replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>   drivers/leds/leds-gpio.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 7bc5328..5883ded 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -104,8 +104,8 @@ static int create_gpio_led(const struct gpio_led *template,
>   			return ret;
>
>   		led_dat->gpiod = gpio_to_desc(template->gpio);
> -		if (IS_ERR(led_dat->gpiod))
> -			return PTR_ERR(led_dat->gpiod);
> +		if (!led_dat->gpiod)
> +			return -EINVAL;
>   	}
>
>   	led_dat->cdev.name = template->name;
>
>
>

Thanks for the patch, applied.

-- 
Best Regards,
Jacek Anaszewski

      reply	other threads:[~2016-02-08  8:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06 14:37 [PATCH] leds: leds-gpio: Fix return value check in create_gpio_led() weiyj_lk
2016-02-08  8:09 ` Jacek Anaszewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B84D49.1030400@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=weiyj_lk@163.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.