gpiolib: legacy: Remove unused gpio_request_array() and gpio_free_array()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 7 Mar 2024 13:49:05 +0000 (15:49 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 3 Apr 2024 11:07:52 +0000 (13:07 +0200)
No more users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Yanteng Si <siyanteng@loongson.cn>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Documentation/driver-api/gpio/legacy.rst
Documentation/translations/zh_CN/driver-api/gpio/legacy.rst
Documentation/translations/zh_TW/gpio.txt
drivers/gpio/gpiolib-legacy.c
include/linux/gpio.h

index b6505914791c7d2dead8210d0a5c222ec98152ae..534dfe95d128b89f277dba671bf6223c328367dd 100644 (file)
@@ -225,8 +225,6 @@ setup or driver probe/teardown code, so this is an easy constraint.)::
                 gpio_request()
 
         ##     gpio_request_one()
-        ##     gpio_request_array()
-        ##     gpio_free_array()
 
                 gpio_free()
 
@@ -295,14 +293,6 @@ are claimed, three additional calls are defined::
         */
        int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
 
-       /* request multiple GPIOs in a single call
-        */
-       int gpio_request_array(struct gpio *array, size_t num);
-
-       /* release multiple GPIOs in a single call
-        */
-       void gpio_free_array(struct gpio *array, size_t num);
-
 where 'flags' is currently defined to specify the following properties:
 
        * GPIOF_DIR_IN          - to configure direction as input
@@ -341,12 +331,6 @@ A typical example of usage::
        if (err)
                ...
 
-       err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios));
-       if (err)
-               ...
-
-       gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios));
-
 
 GPIOs mapped to IRQs
 --------------------
index aeccff777170903f56a3eab7bbb231aa25f8676c..0faf042001d24129974f75a56a4b33d52e15431f 100644 (file)
@@ -208,8 +208,6 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其
                 gpio_request()
 
         ##     gpio_request_one()
-        ##     gpio_request_array()
-        ##     gpio_free_array()
 
                 gpio_free()
 
@@ -272,14 +270,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的
         */
        int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
 
-       /* 在单个函数中申请多个 GPIO
-        */
-       int gpio_request_array(struct gpio *array, size_t num);
-
-       /* 在单个函数中释放多个 GPIO
-        */
-       void gpio_free_array(struct gpio *array, size_t num);
-
 这里 'flags' 当前定义可指定以下属性:
 
        * GPIOF_DIR_IN          - 配置方向为输入
@@ -317,12 +307,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的
        if (err)
                ...
 
-       err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios));
-       if (err)
-               ...
-
-       gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios));
-
 
 GPIO 映射到 IRQ
 ----------------
index b9b48012c62e59050cf78bd07fa0fb087d5ce20a..77d69d38131637c90a3ce83747ed79aa83c2b3aa 100644 (file)
@@ -215,13 +215,10 @@ GPIO 值的命令需要等待其信息排到隊首才發送命令,再獲得其
        gpio_request()
 
 ##     gpio_request_one()
-##     gpio_request_array()
-##     gpio_free_array()
 
        gpio_free()
 
 
-
 聲明和釋放 GPIO
 ----------------------------
 爲了有助於捕獲系統配置錯誤,定義了兩個函數。
@@ -278,14 +275,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映
         */
        int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
 
-       /* 在單個函數中申請多個 GPIO
-        */
-       int gpio_request_array(struct gpio *array, size_t num);
-
-       /* 在單個函數中釋放多個 GPIO
-        */
-       void gpio_free_array(struct gpio *array, size_t num);
-
 這裡 'flags' 當前定義可指定以下屬性:
 
        * GPIOF_DIR_IN          - 配置方向爲輸入
@@ -323,12 +312,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映
        if (err)
                ...
 
-       err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios));
-       if (err)
-               ...
-
-       gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios));
-
 
 GPIO 映射到 IRQ
 --------------------
index b138682fec3d686a6e334b36a82eccfd8b41ebe8..616d60187f85885869b4d812eafb087bf8f2fe7c 100644 (file)
@@ -72,42 +72,3 @@ int gpio_request(unsigned gpio, const char *label)
        return gpiod_request(desc, label);
 }
 EXPORT_SYMBOL_GPL(gpio_request);
-
-/**
- * gpio_request_array - request multiple GPIOs in a single call
- * @array:     array of the 'struct gpio'
- * @num:       how many GPIOs in the array
- *
- * **DEPRECATED** This function is deprecated and must not be used in new code.
- */
-int gpio_request_array(const struct gpio *array, size_t num)
-{
-       int i, err;
-
-       for (i = 0; i < num; i++, array++) {
-               err = gpio_request_one(array->gpio, array->flags, array->label);
-               if (err)
-                       goto err_free;
-       }
-       return 0;
-
-err_free:
-       while (i--)
-               gpio_free((--array)->gpio);
-       return err;
-}
-EXPORT_SYMBOL_GPL(gpio_request_array);
-
-/**
- * gpio_free_array - release multiple GPIOs in a single call
- * @array:     array of the 'struct gpio'
- * @num:       how many GPIOs in the array
- *
- * **DEPRECATED** This function is deprecated and must not be used in new code.
- */
-void gpio_free_array(const struct gpio *array, size_t num)
-{
-       while (num--)
-               gpio_free((array++)->gpio);
-}
-EXPORT_SYMBOL_GPL(gpio_free_array);
index 7ecc25c543cef36b24425b479492dc366a7003da..4aaedcf424ce61582b1b3e0c029115d6f4f0e669 100644 (file)
@@ -114,8 +114,6 @@ static inline int gpio_to_irq(unsigned gpio)
 }
 
 int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
-int gpio_request_array(const struct gpio *array, size_t num);
-void gpio_free_array(const struct gpio *array, size_t num);
 
 /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */
 
@@ -146,11 +144,6 @@ static inline int gpio_request_one(unsigned gpio,
        return -ENOSYS;
 }
 
-static inline int gpio_request_array(const struct gpio *array, size_t num)
-{
-       return -ENOSYS;
-}
-
 static inline void gpio_free(unsigned gpio)
 {
        might_sleep();
@@ -159,14 +152,6 @@ static inline void gpio_free(unsigned gpio)
        WARN_ON(1);
 }
 
-static inline void gpio_free_array(const struct gpio *array, size_t num)
-{
-       might_sleep();
-
-       /* GPIO can never have been requested */
-       WARN_ON(1);
-}
-
 static inline int gpio_direction_input(unsigned gpio)
 {
        return -ENOSYS;