gpiolib: of: stop exporting of_gpio_named_count()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 19 Dec 2022 19:20:13 +0000 (11:20 -0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 30 Jan 2023 14:55:28 +0000 (15:55 +0100)
The only user of this function is gpiolib-of.c so move it there.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-of.c
include/linux/of_gpio.h

index 4fff725..6724e37 100644 (file)
 #include "gpiolib-of.h"
 
 /**
+ * of_gpio_named_count() - Count GPIOs for a device
+ * @np:                device node to count GPIOs for
+ * @propname:  property name containing gpio specifier(s)
+ *
+ * The function returns the count of GPIOs specified for a node.
+ * Note that the empty GPIO specifiers count too. Returns either
+ *   Number of gpios defined in property,
+ *   -EINVAL for an incorrectly formed gpios property, or
+ *   -ENOENT for a missing gpios property
+ *
+ * Example:
+ * gpios = <0
+ *          &gpio1 1 2
+ *          0
+ *          &gpio2 3 4>;
+ *
+ * The above example defines four GPIOs, two of which are not specified.
+ * This function will return '4'
+ */
+static int of_gpio_named_count(const struct device_node *np,
+                              const char *propname)
+{
+       return of_count_phandle_with_args(np, propname, "#gpio-cells");
+}
+
+/**
  * of_gpio_spi_cs_get_count() - special GPIO counting for SPI
  * @dev:    Consuming device
  * @con_id: Function within the GPIO consumer
index 39f16a9..680025c 100644 (file)
@@ -79,32 +79,6 @@ static inline int of_get_named_gpio_flags(const struct device_node *np,
 
 #endif /* CONFIG_OF_GPIO */
 
-/**
- * of_gpio_named_count() - Count GPIOs for a device
- * @np:                device node to count GPIOs for
- * @propname:  property name containing gpio specifier(s)
- *
- * The function returns the count of GPIOs specified for a node.
- * Note that the empty GPIO specifiers count too. Returns either
- *   Number of gpios defined in property,
- *   -EINVAL for an incorrectly formed gpios property, or
- *   -ENOENT for a missing gpios property
- *
- * Example:
- * gpios = <0
- *          &gpio1 1 2
- *          0
- *          &gpio2 3 4>;
- *
- * The above example defines four GPIOs, two of which are not specified.
- * This function will return '4'
- */
-static inline int of_gpio_named_count(const struct device_node *np,
-                                     const char *propname)
-{
-       return of_count_phandle_with_args(np, propname, "#gpio-cells");
-}
-
 static inline int of_get_gpio_flags(const struct device_node *np, int index,
                      enum of_gpio_flags *flags)
 {