Skip to content

Commit 89ad556

Browse files
thierryredinglinusw
authored andcommitted
gpio: Avoid using pin ranges with !PINCTRL
Do not use the struct gpio_device's .pin_ranges field if the PINCTRL Kconfig symbol is not selected to avoid build failures. Fixes: 2ab73c6 ("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]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Geert Uytterhoeven <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 5f4bf17 commit 89ad556

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/gpio/gpiolib.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,10 +2745,12 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip)
27452745
*/
27462746
int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset)
27472747
{
2748-
if (!list_empty(&chip->gpiodev->pin_ranges))
2749-
return pinctrl_gpio_request(chip->gpiodev->base + offset);
2748+
#ifdef CONFIG_PINCTRL
2749+
if (list_empty(&chip->gpiodev->pin_ranges))
2750+
return 0;
2751+
#endif
27502752

2751-
return 0;
2753+
return pinctrl_gpio_request(chip->gpiodev->base + offset);
27522754
}
27532755
EXPORT_SYMBOL_GPL(gpiochip_generic_request);
27542756

0 commit comments

Comments
 (0)