gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 25 Jan 2024 08:15:59 +0000 (09:15 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 13 Feb 2024 10:02:47 +0000 (11:02 +0100)
Add empty stub of gpiod_to_gpio_device() when GPIOLIB is not enabled.

Cc: <stable@vger.kernel.org>
Fixes: 370232d096e3 ("gpiolib: provide gpiod_to_gpio_device()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
include/linux/gpio/driver.h

index 9a5c6c76e6533385dbb32de98abfd330c8736585..012797e7106d89abd79c3eb62954a9ffeb26720a 100644 (file)
@@ -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)
 {