* [PATCH] gpio: Avoid using pin ranges with !PINCTRL
@ 2020-03-30 9:02 Thierry Reding
2020-03-31 13:05 ` Geert Uytterhoeven
2020-03-31 14:48 ` Linus Walleij
0 siblings, 2 replies; 4+ messages in thread
From: Thierry Reding @ 2020-03-30 9:02 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: linux-gpio, linux-kernel, Stephen Rothwell, kbuild test robot
From: Thierry Reding <treding@nvidia.com>
Do not use the struct gpio_device's .pin_ranges field if the PINCTRL
Kconfig symbol is not selected to avoid build failures.
Fixes: d2fbe53a806e ("gpio: Support GPIO controllers without pin-ranges")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpio/gpiolib.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e6f9def09f55..5c245883c9c5 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2753,10 +2753,12 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip)
*/
int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset)
{
- if (!list_empty(&chip->gpiodev->pin_ranges))
- return pinctrl_gpio_request(chip->gpiodev->base + offset);
+#ifdef CONFIG_PINCTRL
+ if (list_empty(&chip->gpiodev->pin_ranges))
+ return 0;
+#endif
- return 0;
+ return pinctrl_gpio_request(chip->gpiodev->base + offset);
}
EXPORT_SYMBOL_GPL(gpiochip_generic_request);
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: Avoid using pin ranges with !PINCTRL
2020-03-30 9:02 [PATCH] gpio: Avoid using pin ranges with !PINCTRL Thierry Reding
@ 2020-03-31 13:05 ` Geert Uytterhoeven
2020-03-31 20:55 ` Thierry Reding
2020-03-31 14:48 ` Linus Walleij
1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-03-31 13:05 UTC (permalink / raw)
To: Thierry Reding
Cc: Linus Walleij, Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
Linux Kernel Mailing List, Stephen Rothwell, kbuild test robot
Hi Thierry,
Thanks for your patch!
On Mon, Mar 30, 2020 at 11:03 AM Thierry Reding
<thierry.reding@gmail.com> wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Do not use the struct gpio_device's .pin_ranges field if the PINCTRL
> Kconfig symbol is not selected to avoid build failures.
>
> Fixes: d2fbe53a806e ("gpio: Support GPIO controllers without pin-ranges")
WARNING: Unknown commit id 'd2fbe53a806e', maybe rebased or not pulled?
Fixes: 2ab73c6d8323fa1e ("gpio: Support GPIO controllers without pin-ranges")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
With the above fixed:
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
This fixes the build (and boot) for rbtx4927, so:
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: Avoid using pin ranges with !PINCTRL
2020-03-30 9:02 [PATCH] gpio: Avoid using pin ranges with !PINCTRL Thierry Reding
2020-03-31 13:05 ` Geert Uytterhoeven
@ 2020-03-31 14:48 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2020-03-31 14:48 UTC (permalink / raw)
To: Thierry Reding
Cc: Bartosz Golaszewski, open list:GPIO SUBSYSTEM, linux-kernel,
Stephen Rothwell, kbuild test robot
On Mon, Mar 30, 2020 at 11:03 AM Thierry Reding
<thierry.reding@gmail.com> wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Do not use the struct gpio_device's .pin_ranges field if the PINCTRL
> Kconfig symbol is not selected to avoid build failures.
>
> Fixes: d2fbe53a806e ("gpio: Support GPIO controllers without pin-ranges")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
Patch applied with Geert's tags and fixes.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: Avoid using pin ranges with !PINCTRL
2020-03-31 13:05 ` Geert Uytterhoeven
@ 2020-03-31 20:55 ` Thierry Reding
0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2020-03-31 20:55 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Walleij, Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
Linux Kernel Mailing List, Stephen Rothwell, kbuild test robot
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
On Tue, Mar 31, 2020 at 03:05:43PM +0200, Geert Uytterhoeven wrote:
> Hi Thierry,
>
> Thanks for your patch!
>
> On Mon, Mar 30, 2020 at 11:03 AM Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > Do not use the struct gpio_device's .pin_ranges field if the PINCTRL
> > Kconfig symbol is not selected to avoid build failures.
> >
> > Fixes: d2fbe53a806e ("gpio: Support GPIO controllers without pin-ranges")
>
> WARNING: Unknown commit id 'd2fbe53a806e', maybe rebased or not pulled?
>
> Fixes: 2ab73c6d8323fa1e ("gpio: Support GPIO controllers without pin-ranges")
Yeah, it looks like I made this patch on top of my local tree but forgot
to rebase on the latest linux-next.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-31 20:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 9:02 [PATCH] gpio: Avoid using pin ranges with !PINCTRL Thierry Reding
2020-03-31 13:05 ` Geert Uytterhoeven
2020-03-31 20:55 ` Thierry Reding
2020-03-31 14:48 ` Linus Walleij
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).