gpio: legacy: mark old interfaces as deprecated in kernel docs
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 4 Jan 2024 18:20:34 +0000 (19:20 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 22 Jan 2024 08:43:33 +0000 (09:43 +0100)
We've recently had someone try to use of_get_named_gpio() in new code.
Mark legacy interfaces as deprecated in kernel docs to avoid any
confusion.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-legacy.c
drivers/gpio/gpiolib-of.c

index 97f4b498e343d1c9f6fdffb026dc5a3ede6075c7..b138682fec3d686a6e334b36a82eccfd8b41ebe8 100644 (file)
@@ -6,6 +6,9 @@
 
 #include "gpiolib.h"
 
+/*
+ * **DEPRECATED** This function is deprecated and must not be used in new code.
+ */
 void gpio_free(unsigned gpio)
 {
        gpiod_free(gpio_to_desc(gpio));
@@ -17,6 +20,8 @@ EXPORT_SYMBOL_GPL(gpio_free);
  * @gpio:      the GPIO number
  * @flags:     GPIO configuration as specified by GPIOF_*
  * @label:     a literal description string of this GPIO
+ *
+ * **DEPRECATED** This function is deprecated and must not be used in new code.
  */
 int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
 {
@@ -53,6 +58,9 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
 }
 EXPORT_SYMBOL_GPL(gpio_request_one);
 
+/*
+ * **DEPRECATED** This function is deprecated and must not be used in new code.
+ */
 int gpio_request(unsigned gpio, const char *label)
 {
        struct gpio_desc *desc = gpio_to_desc(gpio);
@@ -69,6 +77,8 @@ 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)
 {
@@ -92,6 +102,8 @@ 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)
 {
index e7770eedd14693ac827a0c4ce875aa5484e84a80..77509aa19900264b009a8e8259e7ac5bd46dbce8 100644 (file)
@@ -414,6 +414,8 @@ out:
  * @propname:  Name of property containing gpio specifier(s)
  * @index:     index of the GPIO
  *
+ * **DEPRECATED** This function is deprecated and must not be used in new code.
+ *
  * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
  * value on the error condition.
  */