OSDN Git Service

gpio: sifive: Get the parent IRQ's domain from its irq_data
authorSamuel Holland <samuel.holland@sifive.com>
Tue, 25 Jul 2023 00:40:41 +0000 (17:40 -0700)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 25 Jul 2023 10:00:29 +0000 (12:00 +0200)
commit3b5560c8f074aee8839b66093b4d565702a6921d
tree54421dc114712533d11c7a49cc560abfd420ddec
parent1cd9cee75f99cfe31a6e339af518679649812838
gpio: sifive: Get the parent IRQ's domain from its irq_data

Do not parse the devicetree again when the data is already available
from the IRQ subsystem. This follows the example of the ThunderX and
X-Gene GPIO drivers. The ngpio check is needed to avoid a possible
out-of-bounds read.

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