From: Krzysztof Kozlowski Date: Thu, 25 Jan 2024 08:15:59 +0000 (+0100) Subject: gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6ac86372102b477083db99a9af8246fb916271b5;p=linux.git gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB Add empty stub of gpiod_to_gpio_device() when GPIOLIB is not enabled. Cc: Fixes: 370232d096e3 ("gpiolib: provide gpiod_to_gpio_device()") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski --- diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 9a5c6c76e6533..012797e7106d8 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -819,6 +819,12 @@ static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) return ERR_PTR(-ENODEV); } +static inline struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc) +{ + WARN_ON(1); + return ERR_PTR(-ENODEV); +} + static inline int gpiochip_lock_as_irq(struct gpio_chip *gc, unsigned int offset) {