]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpiolib: Remove unused devm_gpio_request()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 31 May 2025 21:21:39 +0000 (00:21 +0300)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 10 Jun 2025 08:06:41 +0000 (10:06 +0200)
Remove devm_gpio_request() due to lack of users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250531212331.3635269-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Documentation/driver-api/driver-model/devres.rst
drivers/gpio/gpiolib-legacy.c
include/linux/gpio.h

index 3d56f94ac2eef003eee54c0ce80234122ff2931f..2b36ebde9cece8ce1aa34c2bc86cbe2b369904a1 100644 (file)
@@ -275,7 +275,6 @@ GPIO
   devm_gpiod_put()
   devm_gpiod_unhinge()
   devm_gpiochip_add_data()
-  devm_gpio_request()
   devm_gpio_request_one()
 
 I2C
index aeae6df8bec993314157a494cc068c5f6a090217..3bc93ccadb5b5228606f60e00dbbf5099f4f4651 100644 (file)
@@ -85,44 +85,6 @@ static void devm_gpio_release(struct device *dev, void *res)
        gpio_free(*gpio);
 }
 
-/**
- * devm_gpio_request - request a GPIO for a managed device
- * @dev: device to request the GPIO for
- * @gpio: GPIO to allocate
- * @label: the name of the requested GPIO
- *
- * Except for the extra @dev argument, this function takes the
- * same arguments and performs the same function as gpio_request().
- * GPIOs requested with this function will be automatically freed
- * on driver detach.
- *
- * **DEPRECATED** This function is deprecated and must not be used in new code.
- *
- * Returns:
- * 0 on success, or negative errno on failure.
- */
-int devm_gpio_request(struct device *dev, unsigned gpio, const char *label)
-{
-       unsigned *dr;
-       int rc;
-
-       dr = devres_alloc(devm_gpio_release, sizeof(unsigned), GFP_KERNEL);
-       if (!dr)
-               return -ENOMEM;
-
-       rc = gpio_request(gpio, label);
-       if (rc) {
-               devres_free(dr);
-               return rc;
-       }
-
-       *dr = gpio;
-       devres_add(dev, dr);
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(devm_gpio_request);
-
 /**
  * devm_gpio_request_one - request a single GPIO with initial setup
  * @dev: device to request for
index c1ec62c11ed3c853df4570cceaceee84dcacb512..61e9f43c082aeab9a226c93c7f757c30c394f192 100644 (file)
@@ -110,7 +110,6 @@ static inline int gpio_to_irq(unsigned gpio)
 
 int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
 
-int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
 int devm_gpio_request_one(struct device *dev, unsigned gpio,
                          unsigned long flags, const char *label);
 
@@ -188,13 +187,6 @@ static inline int gpio_to_irq(unsigned gpio)
        return -EINVAL;
 }
 
-static inline int devm_gpio_request(struct device *dev, unsigned gpio,
-                                   const char *label)
-{
-       WARN_ON(1);
-       return -EINVAL;
-}
-
 static inline int devm_gpio_request_one(struct device *dev, unsigned gpio,
                                        unsigned long flags, const char *label)
 {