All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: Re: [PATCH] gpio: xgs-iproc: fix parsing of ngpios property
Date: Mon, 25 Oct 2021 10:12:05 +0200	[thread overview]
Message-ID: <CAMRc=Mfa0LaCHdop97BzAazo209Sy-twrzQkFMbh51ZGs+H_kw@mail.gmail.com> (raw)
In-Reply-To: <20211014123342.174711-1-jonas.gorski@gmail.com>

On Thu, Oct 14, 2021 at 2:33 PM Jonas Gorski <jonas.gorski@gmail.com> wrote:
>
> of_property_read_u32 returns 0 on success, not true, so we need to
> invert the check to actually take over the provided ngpio value.
>
> Fixes: 6a41b6c5fc20 ("gpio: Add xgs-iproc driver")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
> This is based on
> git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git,
> which is the tree for GPIO according to MAINTAINERS, but hasn't been
> updated since ~5.11 - is this still the correct tree?
>
> It doesn't matter much for this patch though, the driver is virtually
> untouched since then.
>
>  drivers/gpio/gpio-xgs-iproc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c
> index ad5489a65d54..dd40277b9d06 100644
> --- a/drivers/gpio/gpio-xgs-iproc.c
> +++ b/drivers/gpio/gpio-xgs-iproc.c
> @@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
>         }
>
>         chip->gc.label = dev_name(dev);
> -       if (of_property_read_u32(dn, "ngpios", &num_gpios))
> +       if (!of_property_read_u32(dn, "ngpios", &num_gpios))
>                 chip->gc.ngpio = num_gpios;
>
>         irq = platform_get_irq(pdev, 0);
> --
> 2.33.0
>

Queued for fixes.

Bart

WARNING: multiple messages have this Message-ID (diff)
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	 Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	 Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	 bcm-kernel-feedback-list@broadcom.com,
	 Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: Re: [PATCH] gpio: xgs-iproc: fix parsing of ngpios property
Date: Mon, 25 Oct 2021 10:12:05 +0200	[thread overview]
Message-ID: <CAMRc=Mfa0LaCHdop97BzAazo209Sy-twrzQkFMbh51ZGs+H_kw@mail.gmail.com> (raw)
In-Reply-To: <20211014123342.174711-1-jonas.gorski@gmail.com>

On Thu, Oct 14, 2021 at 2:33 PM Jonas Gorski <jonas.gorski@gmail.com> wrote:
>
> of_property_read_u32 returns 0 on success, not true, so we need to
> invert the check to actually take over the provided ngpio value.
>
> Fixes: 6a41b6c5fc20 ("gpio: Add xgs-iproc driver")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
> This is based on
> git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git,
> which is the tree for GPIO according to MAINTAINERS, but hasn't been
> updated since ~5.11 - is this still the correct tree?
>
> It doesn't matter much for this patch though, the driver is virtually
> untouched since then.
>
>  drivers/gpio/gpio-xgs-iproc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c
> index ad5489a65d54..dd40277b9d06 100644
> --- a/drivers/gpio/gpio-xgs-iproc.c
> +++ b/drivers/gpio/gpio-xgs-iproc.c
> @@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
>         }
>
>         chip->gc.label = dev_name(dev);
> -       if (of_property_read_u32(dn, "ngpios", &num_gpios))
> +       if (!of_property_read_u32(dn, "ngpios", &num_gpios))
>                 chip->gc.ngpio = num_gpios;
>
>         irq = platform_get_irq(pdev, 0);
> --
> 2.33.0
>

Queued for fixes.

Bart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-10-25  8:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 12:33 [PATCH] gpio: xgs-iproc: fix parsing of ngpios property Jonas Gorski
2021-10-14 12:33 ` Jonas Gorski
2021-10-17 23:21 ` Chris Packham
2021-10-17 23:21   ` Chris Packham
2021-10-22 19:29 ` Florian Fainelli
2021-10-22 19:29   ` Florian Fainelli
2021-10-24 23:49 ` Linus Walleij
2021-10-24 23:49   ` Linus Walleij
2021-10-25  8:12 ` Bartosz Golaszewski [this message]
2021-10-25  8:12   ` Bartosz Golaszewski
2021-10-31 13:24 ` Andy Shevchenko
2021-10-31 13:24   ` Andy Shevchenko
2021-11-02 13:09   ` Bartosz Golaszewski
2021-11-02 13:09     ` 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='CAMRc=Mfa0LaCHdop97BzAazo209Sy-twrzQkFMbh51ZGs+H_kw@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=jonas.gorski@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    /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.