Commit 4ee82256 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Linus Walleij

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: default avatarDmitry Osipenko <digetx@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Link: https://lore.kernel.org/r/20200709171203.12950-2-digetx@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 1752911c
...@@ -19,8 +19,8 @@ struct max77620_gpio { ...@@ -19,8 +19,8 @@ struct max77620_gpio {
struct regmap *rmap; struct regmap *rmap;
struct device *dev; struct device *dev;
struct mutex buslock; /* irq_bus_lock */ struct mutex buslock; /* irq_bus_lock */
unsigned int irq_type[8]; unsigned int irq_type[MAX77620_GPIO_NR];
bool irq_enabled[8]; bool irq_enabled[MAX77620_GPIO_NR];
}; };
static irqreturn_t max77620_gpio_irqhandler(int irq, void *data) static irqreturn_t max77620_gpio_irqhandler(int irq, void *data)
...@@ -38,7 +38,7 @@ static irqreturn_t max77620_gpio_irqhandler(int irq, void *data) ...@@ -38,7 +38,7 @@ static irqreturn_t max77620_gpio_irqhandler(int irq, void *data)
pending = value; pending = value;
for_each_set_bit(offset, &pending, 8) { for_each_set_bit(offset, &pending, MAX77620_GPIO_NR) {
unsigned int virq; unsigned int virq;
virq = irq_find_mapping(gpio->gpio_chip.irq.domain, offset); virq = irq_find_mapping(gpio->gpio_chip.irq.domain, offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment