From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
linux-gpio@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Gregory Clement <gregory.clement@bootlin.com>
Subject: [PATCH v1 2/5] ARM/orion/gpio: Make use of for_each_requested_gpio()
Date: Mon, 15 Jun 2020 18:05:42 +0300 [thread overview]
Message-ID: <20200615150545.87964-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200615150545.87964-1-andriy.shevchenko@linux.intel.com>
Make use of for_each_requested_gpio() instead of home grown analogue.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Gregory Clement <gregory.clement@bootlin.com>
---
arch/arm/plat-orion/gpio.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 26a531ebb6e9..734f0be4f14a 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -442,6 +442,7 @@ static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
struct orion_gpio_chip *ochip = gpiochip_get_data(chip);
u32 out, io_conf, blink, in_pol, data_in, cause, edg_msk, lvl_msk;
+ const char *label;
int i;
out = readl_relaxed(GPIO_OUT(ochip));
@@ -453,15 +454,10 @@ static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
edg_msk = readl_relaxed(GPIO_EDGE_MASK(ochip));
lvl_msk = readl_relaxed(GPIO_LEVEL_MASK(ochip));
- for (i = 0; i < chip->ngpio; i++) {
- const char *label;
+ for_each_requested_gpio(chip, i, label) {
u32 msk;
bool is_out;
- label = gpiochip_is_requested(chip, i);
- if (!label)
- continue;
-
msk = 1 << i;
is_out = !(io_conf & msk);
--
2.27.0.rc2
next prev parent reply other threads:[~2020-06-15 15:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 15:05 [PATCH v1 0/5] gpio, pinctrl, introduce for_each_requested_gpio() helper Andy Shevchenko
2020-06-15 15:05 ` [PATCH v1 1/5] gpiolib: Introduce for_each_requested_gpio_in_range() macro Andy Shevchenko
2020-06-15 15:05 ` Andy Shevchenko [this message]
2020-06-16 20:43 ` [PATCH v1 2/5] ARM/orion/gpio: Make use of for_each_requested_gpio() Andrew Lunn
2020-07-18 20:52 ` Gregory CLEMENT
2020-07-18 21:31 ` Andy Shevchenko
2020-06-15 15:05 ` [PATCH v1 3/5] gpio: mvebu: " Andy Shevchenko
2020-06-15 15:05 ` [PATCH v1 4/5] gpio: xra1403: " Andy Shevchenko
2020-06-15 15:05 ` [PATCH v1 5/5] pinctrl: at91: " Andy Shevchenko
2020-06-20 21:16 ` [PATCH v1 0/5] gpio, pinctrl, introduce for_each_requested_gpio() helper Linus Walleij
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=20200615150545.87964-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andrew@lunn.ch \
--cc=bgolaszewski@baylibre.com \
--cc=gregory.clement@bootlin.com \
--cc=jason@lakedaemon.net \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=sebastian.hesselbarth@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).