gpio: s5p: increment bank base address only if bank is initialized
authorKaustabh Chakraborty <kauschluss@disroot.org>
Tue, 21 Oct 2025 14:21:35 +0000 (19:51 +0530)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 25 Nov 2025 10:00:47 +0000 (19:00 +0900)
commit4937a9778cfb22cad3f411522c62a14d5242e55e
tree9263db6864c1b86b7d195a76c35ea3bef0492950
parent1ca7bcdb9d6489caa55742a2938be2091d24e3b2
gpio: s5p: increment bank base address only if bank is initialized

There is a condition guard which ensures that the GPIO node, indeed
describes a GPIO controller.

if (!fdtdec_get_bool(blob, node, "gpio-controller"))
continue;

Since the bank base is being incremented in the loop, it is done so
irrespective of whether the node is a GPIO controller or not. This leads
to the incorrect resolution of bank base addresses.

Move it out of the loop, and instead increment the bank base address
only if the driver successfully binds a GPIO controller.

Reviewed-by: Henrik Grimler <henrik@grimler.se>
Fixes: b8809e60cdb5 ("dm: exynos: gpio: Convert to driver model")
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/gpio/s5p_gpio.c