From: Andy Shevchenko Date: Mon, 15 Jun 2020 15:05:45 +0000 (+0300) Subject: pinctrl: at91: Make use of for_each_requested_gpio() X-Git-Tag: v5.9-rc1~77^2~73^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bae1f08e2853d17ce2ceeca71fe5a3ee03a0a69;p=thirdparty%2Fkernel%2Flinux.git pinctrl: at91: Make use of for_each_requested_gpio() Make use of for_each_requested_gpio() instead of home grown analogue. Signed-off-by: Andy Shevchenko Cc: Ludovic Desroches Cc: Nicolas Ferre Cc: Alexandre Belloni Link: https://lore.kernel.org/r/20200615150545.87964-6-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 52386ad29f282..9c52130876597 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -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);