From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
"Maciej S. Szmigiero" <mail@maciej.szmigiero.name>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] gpio: winbond: Fix error code in winbond_gpio_get()
Date: Thu, 23 Jun 2022 12:54:35 +0300 [thread overview]
Message-ID: <YrQ4WwSzhpai0aPc@smile.fi.intel.com> (raw)
In-Reply-To: <YrQkfBuIHArxHSNr@kili>
On Thu, Jun 23, 2022 at 11:29:48AM +0300, Dan Carpenter wrote:
> This error path returns 1, but it should instead propagate the negative
> error code from winbond_sio_enter().
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Fixes: a0d65009411c ("gpio: winbond: Add driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/gpio/gpio-winbond.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-winbond.c b/drivers/gpio/gpio-winbond.c
> index 7f8f5b02e31d..4b61d975cc0e 100644
> --- a/drivers/gpio/gpio-winbond.c
> +++ b/drivers/gpio/gpio-winbond.c
> @@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, unsigned int offset)
> unsigned long *base = gpiochip_get_data(gc);
> const struct winbond_gpio_info *info;
> bool val;
> + int ret;
>
> winbond_gpio_get_info(&offset, &info);
>
> - val = winbond_sio_enter(*base);
> - if (val)
> - return val;
> + ret = winbond_sio_enter(*base);
> + if (ret)
> + return ret;
>
> winbond_sio_select_logical(*base, info->dev);
>
> --
> 2.35.1
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-06-23 9:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 8:29 [PATCH] gpio: winbond: Fix error code in winbond_gpio_get() Dan Carpenter
2022-06-23 9:54 ` Andy Shevchenko [this message]
2022-06-23 14:30 ` Bartosz Golaszewski
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=YrQ4WwSzhpai0aPc@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mail@maciej.szmigiero.name \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox