gpio: sifive: Look up IRQs only once during probe
authorSamuel Holland <samuel.holland@sifive.com>
Tue, 25 Jul 2023 00:40:40 +0000 (17:40 -0700)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 25 Jul 2023 10:00:15 +0000 (12:00 +0200)
commit1cd9cee75f99cfe31a6e339af518679649812838
tree9874f25c4bcb6b4b82672aed0b07c1ae3b13d536
parent5d472a7ef0f35e39906ef0eafa0c76727949f56b
gpio: sifive: Look up IRQs only once during probe

of_irq_count(), or eqivalently platform_irq_count(), simply looks up
successively-numbered IRQs until that fails. Since this driver needs to
look up each IRQ anyway to get its virq number, use that existing loop
to count the IRQs at the same time.

The check against SIFIVE_GPIO_MAX functioned as a bounds check for
chip->irq_number. That is now handled by the loop condition.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-sifive.c