Skip to content

Commit

Permalink
ARM/orion/gpio: Make use of for_each_requested_gpio()
Browse files Browse the repository at this point in the history
Make use of for_each_requested_gpio() instead of home grown analogue.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
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>
Link: https://lore.kernel.org/r/20200615150545.87964-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Linus Walleij committed Jun 20, 2020
1 parent b3337eb commit aed8fa1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/arm/plat-orion/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);

Expand Down

0 comments on commit aed8fa1

Please sign in to comment.