Skip to content

Commit 7796cdc

Browse files
andy-shevlinusw
authored andcommitted
gpio: xra1403: Make use of for_each_requested_gpio()
Make use of for_each_requested_gpio() instead of home grown analogue. Signed-off-by: Andy Shevchenko <[email protected]> Cc: Nandor Han <[email protected]> Cc: Semi Malinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 86661fd commit 7796cdc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/gpio/gpio-xra1403.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ static void xra1403_dbg_show(struct seq_file *s, struct gpio_chip *chip)
121121
struct xra1403 *xra = gpiochip_get_data(chip);
122122
int value[XRA_LAST];
123123
int i;
124+
const char *label;
124125
unsigned int gcr;
125126
unsigned int gsr;
126127

@@ -136,12 +137,7 @@ static void xra1403_dbg_show(struct seq_file *s, struct gpio_chip *chip)
136137

137138
gcr = value[XRA_GCR + 1] << 8 | value[XRA_GCR];
138139
gsr = value[XRA_GSR + 1] << 8 | value[XRA_GSR];
139-
for (i = 0; i < chip->ngpio; i++) {
140-
const char *label = gpiochip_is_requested(chip, i);
141-
142-
if (!label)
143-
continue;
144-
140+
for_each_requested_gpio(chip, i, label) {
145141
seq_printf(s, " gpio-%-3d (%-12s) %s %s\n",
146142
chip->base + i, label,
147143
(gcr & BIT(i)) ? "in" : "out",

0 commit comments

Comments
 (0)