Skip to content

Commit 86661fd

Browse files
andy-shevlinusw
authored andcommitted
gpio: mvebu: 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: Thierry Reding <[email protected]> Cc: "Uwe Kleine-König" <[email protected]> Cc: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent aed8fa1 commit 86661fd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/gpio/gpio-mvebu.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ static void mvebu_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
846846
{
847847
struct mvebu_gpio_chip *mvchip = gpiochip_get_data(chip);
848848
u32 out, io_conf, blink, in_pol, data_in, cause, edg_msk, lvl_msk;
849+
const char *label;
849850
int i;
850851

851852
regmap_read(mvchip->regs, GPIO_OUT_OFF + mvchip->offset, &out);
@@ -857,15 +858,10 @@ static void mvebu_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
857858
edg_msk = mvebu_gpio_read_edge_mask(mvchip);
858859
lvl_msk = mvebu_gpio_read_level_mask(mvchip);
859860

860-
for (i = 0; i < chip->ngpio; i++) {
861-
const char *label;
861+
for_each_requested_gpio(chip, i, label) {
862862
u32 msk;
863863
bool is_out;
864864

865-
label = gpiochip_is_requested(chip, i);
866-
if (!label)
867-
continue;
868-
869865
msk = BIT(i);
870866
is_out = !(io_conf & msk);
871867

0 commit comments

Comments
 (0)