pinctrl: remove pinctrl_gpio_request()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 10 Oct 2023 13:04:24 +0000 (15:04 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Sat, 4 Nov 2023 09:23:21 +0000 (10:23 +0100)
There are no more users of pinctrl_gpio_request() so remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c
include/linux/pinctrl/consumer.h

index a4ea3eb1ccbe50f4021f22c2082aac41ad903af7..bee26db31ee9729ea20b30070ac710777669adf4 100644 (file)
@@ -783,17 +783,25 @@ bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset)
 }
 EXPORT_SYMBOL_GPL(pinctrl_gpio_can_use_line_new);
 
-/* This function is deprecated and will be removed. Don't use. */
-int pinctrl_gpio_request(unsigned gpio)
+/**
+ * pinctrl_gpio_request_new() - request a single pin to be used as GPIO
+ * @gc: GPIO chip structure from the GPIO subsystem
+ * @offset: hardware offset of the GPIO relative to the controller
+ *
+ * This function should *ONLY* be used from gpiolib-based GPIO drivers,
+ * as part of their gpio_request() semantics, platforms and individual drivers
+ * shall *NOT* request GPIO pins to be muxed in.
+ */
+int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
 {
-       struct pinctrl_dev *pctldev;
        struct pinctrl_gpio_range *range;
-       int ret;
-       int pin;
+       struct pinctrl_dev *pctldev;
+       int ret, pin;
 
-       ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
+       ret = pinctrl_get_device_gpio_range(gc->base + offset, &pctldev,
+                                           &range);
        if (ret) {
-               if (pinctrl_ready_for_gpio_range(gpio))
+               if (pinctrl_ready_for_gpio_range(gc->base + offset))
                        ret = 0;
                return ret;
        }
@@ -801,29 +809,14 @@ int pinctrl_gpio_request(unsigned gpio)
        mutex_lock(&pctldev->mutex);
 
        /* Convert to the pin controllers number space */
-       pin = gpio_to_pin(range, gpio);
+       pin = gpio_to_pin(range, gc->base + offset);
 
-       ret = pinmux_request_gpio(pctldev, range, pin, gpio);
+       ret = pinmux_request_gpio(pctldev, range, pin, gc->base + offset);
 
        mutex_unlock(&pctldev->mutex);
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(pinctrl_gpio_request);
-
-/**
- * pinctrl_gpio_request_new() - request a single pin to be used as GPIO
- * @gc: GPIO chip structure from the GPIO subsystem
- * @offset: hardware offset of the GPIO relative to the controller
- *
- * This function should *ONLY* be used from gpiolib-based GPIO drivers,
- * as part of their gpio_request() semantics, platforms and individual drivers
- * shall *NOT* request GPIO pins to be muxed in.
- */
-int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
-{
-       return pinctrl_gpio_request(gc->base + offset);
-}
 EXPORT_SYMBOL_GPL(pinctrl_gpio_request_new);
 
 /* This function is deprecated and will be removed. Don't use. */
index 3991271cc39fa607d421292818fc9dcfb2bb1127..83a414a347cf6260155090c8e9ab198ec2b1a0ec 100644 (file)
@@ -27,7 +27,6 @@ struct pinctrl_state;
 
 /* External interface to pin control */
 bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset);
-int pinctrl_gpio_request(unsigned gpio);
 int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset);
 void pinctrl_gpio_free(unsigned gpio);
 void pinctrl_gpio_free_new(struct gpio_chip *gc, unsigned int offset);
@@ -78,11 +77,6 @@ pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset)
        return true;
 }
 
-static inline int pinctrl_gpio_request(unsigned gpio)
-{
-       return 0;
-}
-
 static inline int
 pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
 {