forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/plat-orion/gpio.c
....@@ -442,6 +442,7 @@
442442
443443 struct orion_gpio_chip *ochip = gpiochip_get_data(chip);
444444 u32 out, io_conf, blink, in_pol, data_in, cause, edg_msk, lvl_msk;
445
+ const char *label;
445446 int i;
446447
447448 out = readl_relaxed(GPIO_OUT(ochip));
....@@ -453,14 +454,9 @@
453454 edg_msk = readl_relaxed(GPIO_EDGE_MASK(ochip));
454455 lvl_msk = readl_relaxed(GPIO_LEVEL_MASK(ochip));
455456
456
- for (i = 0; i < chip->ngpio; i++) {
457
- const char *label;
457
+ for_each_requested_gpio(chip, i, label) {
458458 u32 msk;
459459 bool is_out;
460
-
461
- label = gpiochip_is_requested(chip, i);
462
- if (!label)
463
- continue;
464460
465461 msk = 1 << i;
466462 is_out = !(io_conf & msk);