Message ID | 20240219172514.203750-1-emil.renner.berthing@canonical.com |
---|---|
State | Accepted |
Commit | ae366ba8576da0135d7d3db2dfa6304f3338d0c2 |
Headers | show |
Series | [v1] gpiolib: Handle no pin_ranges in gpiochip_generic_config() | expand |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 8b3a0f45b574..e434e8cc1229 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2042,6 +2042,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_free); int gpiochip_generic_config(struct gpio_chip *gc, unsigned int offset, unsigned long config) { +#ifdef CONFIG_PINCTRL + if (list_empty(&gc->gpiodev->pin_ranges)) + return -ENOTSUPP; +#endif + return pinctrl_gpio_set_config(gc, offset, config); } EXPORT_SYMBOL_GPL(gpiochip_generic_config);