summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2020-07-09 19:11:58 +0200
committerLinus Walleij <linus.walleij@linaro.org>2020-07-16 10:50:40 +0200
commit4ee82256ee57db5c929d3c2f81f6620a0b31b4cd (patch)
tree3cee5ce857f85fe1309beec000d97392720b533c /drivers/gpio
parentMerge tag 'gpio-updates-for-v5.9-part2' of git://git.kernel.org/pub/scm/linux... (diff)
downloadlinux-4ee82256ee57db5c929d3c2f81f6620a0b31b4cd.tar.xz
linux-4ee82256ee57db5c929d3c2f81f6620a0b31b4cd.zip
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 <digetx@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Link: https://lore.kernel.org/r/20200709171203.12950-2-digetx@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-max77620.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index 313bd02dd893..4c0c9ec2587d 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -19,8 +19,8 @@ struct max77620_gpio {
struct regmap *rmap;
struct device *dev;
struct mutex buslock; /* irq_bus_lock */
- unsigned int irq_type[8];
- bool irq_enabled[8];
+ unsigned int irq_type[MAX77620_GPIO_NR];
+ bool irq_enabled[MAX77620_GPIO_NR];
};
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;
- for_each_set_bit(offset, &pending, 8) {
+ for_each_set_bit(offset, &pending, MAX77620_GPIO_NR) {
unsigned int virq;
virq = irq_find_mapping(gpio->gpio_chip.irq.domain, offset);