]> git.ipfire.org Git - thirdparty/u-boot.git/commit
pinctrl: mediatek: fix failing to get syscon
authorDavid Lechner <dlechner@baylibre.com>
Wed, 14 Jan 2026 22:37:19 +0000 (16:37 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 21 Jan 2026 19:30:55 +0000 (13:30 -0600)
commit04413ed0c1bde24bdb4a15e5d75a33f1f3fa8bfa
tree39d125b92010089841d27b2c0eb8c9f0082f4288
parentc196b0a6882929bf0b6504eae963f24289ee5d85
pinctrl: mediatek: fix failing to get syscon

Replace uclass_get_device_by_ofnode() with syscon_regmap_lookup_by_phandle()
to get the "mediatek,pctl-regmap" syscon device.

Depending on probe order, uclass_get_device_by_ofnode() may fail, but
syscon_regmap_lookup_by_phandle() has logic in it to handle that case
correctly.

The previous implementation could read more than one syscon if the
"mediatek,pctl-regmap" property had more than one phandle, but the one
board with a devicetree that does that is not supported in U-Boot yet,
so we can save that for later (it may never be needed).

Fixes: 424ceba18bfb ("pinctrl: mediatek: support mediatek,pctl-regmap property")
Signed-off-by: David Lechner <dlechner@baylibre.com>
drivers/pinctrl/mediatek/Kconfig
drivers/pinctrl/mediatek/pinctrl-mtk-common.c