mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH 2/5] gpiolib: of: stop exporting of_gpio_named_count()
Date: Mon, 19 Dec 2022 11:20:13 -0800	[thread overview]
Message-ID: <20221219192016.1396950-2-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20221219192016.1396950-1-dmitry.torokhov@gmail.com>

The only user of this function is gpiolib-of.c so move it there.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/gpio/gpiolib-of.c | 26 ++++++++++++++++++++++++++
 include/linux/of_gpio.h   | 26 --------------------------
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 4fff7258ee41..6724e375678d 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -23,6 +23,32 @@
 #include "gpiolib.h"
 #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
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 39f16a960565..680025c1a55b 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -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)
 {
-- 
2.39.0.314.g84b9a713c41-goog


  reply	other threads:[~2022-12-19 19:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 19:20 [PATCH 1/5] gpiolib: of: remove of_gpio_count() Dmitry Torokhov
2022-12-19 19:20 ` Dmitry Torokhov [this message]
2022-12-20 13:50   ` [PATCH 2/5] gpiolib: of: stop exporting of_gpio_named_count() Andy Shevchenko
2022-12-20 18:27     ` Dmitry Torokhov
2022-12-20 19:15       ` Andy Shevchenko
2022-12-19 19:20 ` [PATCH 3/5] gpiolib: of: remove obsolete comment for of_gpio_get_count() Dmitry Torokhov
2022-12-20 13:52   ` Andy Shevchenko
2023-01-09 13:07   ` Linus Walleij
2022-12-19 19:20 ` [PATCH 4/5] gpiolib: of: remove of_get_gpio[_flags]() and of_get_named_gpio_flags() Dmitry Torokhov
2022-12-20 13:58   ` Andy Shevchenko
2022-12-20 18:29     ` Dmitry Torokhov
2022-12-20 19:16       ` Andy Shevchenko
2022-12-19 19:20 ` [PATCH 5/5] gpiolib: of: remove [devm_]gpiod_get_from_of_node() APIs Dmitry Torokhov
2022-12-20 14:01   ` Andy Shevchenko
2022-12-20 18:30     ` Dmitry Torokhov
2022-12-20 13:51 ` [PATCH 1/5] gpiolib: of: remove of_gpio_count() Andy Shevchenko
2022-12-20 18:33   ` Dmitry Torokhov
2022-12-30 15:55 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221219192016.1396950-2-dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®