@@ -1486,14 +1486,11 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
int i;
struct at91_gpio_chip *at91_gpio = gpiochip_get_data(chip);
void __iomem *pio = at91_gpio->regbase;
+ const char *gpio_label;
- for (i = 0; i < chip->ngpio; i++) {
+ for_each_requested_gpio(chip, i, gpio_label) {
unsigned mask = pin_to_mask(i);
- const char *gpio_label;
- gpio_label = gpiochip_is_requested(chip, i);
- if (!gpio_label)
- continue;
mode = at91_gpio->ops->get_periph(pio, mask);
seq_printf(s, "[%s] GPIO%s%d: ",
gpio_label, chip->label, i);
Make use of for_each_requested_gpio() instead of home grown analogue. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Ludovic Desroches <ludovic.desroches@microchip.com> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> --- drivers/pinctrl/pinctrl-at91.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)