]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: mediatek: common: Fix probe failure for devices without EINT
authorLuca Leonardo Scorcia <l.scorcia@gmail.com>
Tue, 17 Mar 2026 11:02:06 +0000 (11:02 +0000)
committerLinus Walleij <linusw@kernel.org>
Thu, 19 Mar 2026 18:52:22 +0000 (19:52 +0100)
Some pinctrl devices like mt6397 or mt6392 don't support EINT at all, but
the mtk_eint_init function is always called and returns -ENODEV, which
then bubbles up and causes probe failure.

To address this only call mtk_eint_init if EINT pins are present.

Tested on Xiaomi Mi Smart Clock x04g (mt6392).

Fixes: e46df235b4e6 ("pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit")
Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/mediatek/pinctrl-mtk-common.c

index d6a46fe0cda891436da54dddaf3949a6ccab42a2..3f518dce6d23f1253a3f21e11315eadc6e9ec34c 100644 (file)
@@ -1135,9 +1135,12 @@ int mtk_pctrl_init(struct platform_device *pdev,
                goto chip_error;
        }
 
-       ret = mtk_eint_init(pctl, pdev);
-       if (ret)
-               goto chip_error;
+       /* Only initialize EINT if we have EINT pins */
+       if (data->eint_hw.ap_num > 0) {
+               ret = mtk_eint_init(pctl, pdev);
+               if (ret)
+                       goto chip_error;
+       }
 
        return 0;