gpio: Avoid using pin ranges with !PINCTRL
PATCH 1/1 gpio: Avoid using pin ranges with !PINCTRL
From: Thierry Reding <[email protected]>
Do not use the struct gpio_device's .pin_ranges field if the PINCTRL Kconfig symbol is not selected to avoid build failures.
--- drivers/gpio/gpiolib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpio/gpiolib.c +5 -3
@@ -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);
Signature · 1 line
2.24.1
Hi Thierry,
Thanks for your patch!
Quoted 6 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Do not use the struct gpio_device's .pin_ranges field if the PINCTRL
Kconfigsymbol 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?
Quoted 3 lines
Reported-by Stephen Rothwell <[email protected]>Reported-by kbuild test robot <[email protected]>Signed-off-by Thierry Reding <[email protected]>
With the above fixed:
This fixes the build (and boot) for rbtx4927, so:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
Quoted 8 lines · Geert Uytterhoeven
Hi Thierry,
Thanks for your patch!
Quoted 2 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Quoted 8 lines
Quoted 4 lines
Do not use the struct gpio_device's .pin_ranges field if the PINCTRL
Kconfigsymbol 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
Quoted 9 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Do not use the struct gpio_device's .pin_ranges field if the PINCTRL
Kconfigsymbol is not selected to avoid build failures.Fixes d2fbe53a806e ("gpio: Support GPIO controllers without pin-ranges")Reported-by Stephen Rothwell <[email protected]>Reported-by kbuild test robot <[email protected]>Signed-off-by Thierry Reding <[email protected]>
Patch applied with Geert's tags and fixes.
Yours,
Linus Walleij