[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMpxmJUb43gNHY_pFZyNjVVhumXTQCGkH2m6uM=Aezv3L29ULQ@mail.gmail.com>
Date: Tue, 1 Dec 2020 15:41:59 +0100
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: Will McVicker <willmcvicker@...gle.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Thierry Reding <treding@...dia.com>,
Edmond Chung <edmondchung@...gle.com>,
Andrew Chant <achant@...gle.com>,
linux-gpio <linux-gpio@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>, kernel-team@...roid.com
Subject: Re: [PATCH v1 1/1] gpiolib: Don't free if pin ranges are not defined
On Mon, Nov 30, 2020 at 11:48 PM Will McVicker <willmcvicker@...gle.com> wrote:
>
> From: Edmond Chung <edmondchung@...gle.com>
>
> A similar check was added in gpiochip_generic_request, but not in free.
> This has caused an imbalance count of request vs. free calls to the
> pinctrl driver. This patch is targeted to fix that issue.
>
> Fixes: 2ab73c6d8323 ("gpio: Support GPIO controllers without pin-ranges")
> Signed-off-by: Edmond Chung <edmondchung@...gle.com>
> Signed-off-by: Andrew Chant <achant@...gle.com>
> Signed-off-by: Will McVicker <willmcvicker@...gle.com>
> ---
> drivers/gpio/gpiolib.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 089ddcaa9bc6..6e3c4d7a7d14 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1806,6 +1806,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request);
> */
> void gpiochip_generic_free(struct gpio_chip *gc, unsigned offset)
> {
> +#ifdef CONFIG_PINCTRL
> + if (list_empty(&gc->gpiodev->pin_ranges))
> + return;
> +#endif
> +
> pinctrl_gpio_free(gc->gpiodev->base + offset);
> }
> EXPORT_SYMBOL_GPL(gpiochip_generic_free);
> --
> 2.29.2.454.gaff20da3a2-goog
>
Applied, thanks!
Bartosz
Powered by blists - more mailing lists