Skip to content

Commit 4ee8225

Browse files
digetxlinusw
authored andcommitted
gpio: max77620: Replace 8 with MAX77620_GPIO_NR
The MAX77620_GPIO_NR enum value represents the total number of GPIOs, let's use it instead of a raw value in order to improve the code's readability a tad. Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Laxman Dewangan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 1752911 commit 4ee8225

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio-max77620.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ struct max77620_gpio {
1919
struct regmap *rmap;
2020
struct device *dev;
2121
struct mutex buslock; /* irq_bus_lock */
22-
unsigned int irq_type[8];
23-
bool irq_enabled[8];
22+
unsigned int irq_type[MAX77620_GPIO_NR];
23+
bool irq_enabled[MAX77620_GPIO_NR];
2424
};
2525

2626
static irqreturn_t max77620_gpio_irqhandler(int irq, void *data)
@@ -38,7 +38,7 @@ static irqreturn_t max77620_gpio_irqhandler(int irq, void *data)
3838

3939
pending = value;
4040

41-
for_each_set_bit(offset, &pending, 8) {
41+
for_each_set_bit(offset, &pending, MAX77620_GPIO_NR) {
4242
unsigned int virq;
4343

4444
virq = irq_find_mapping(gpio->gpio_chip.irq.domain, offset);

0 commit comments

Comments
 (0)