mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
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: 2ab73c6d83 ("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]>
This commit is contained in:
committed by
Linus Walleij
parent
5f4bf171ca
commit
89ad556b7f
@@ -2745,10 +2745,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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user