Skip to content

Commit fe412e3

Browse files
wenslinusw
authored andcommitted
pinctrl: mediatek: common-v1: Fix EINT breakage on older controllers
When EINT support for multiple addresses was introduced, the driver library for the older generations (pinctrl-mtk-common) was not fixed together. This resulted in invalid pointer accesses. Fix up the filled in |struct mtk_eint| in pinctrl-mtk-common to match what is now expected by the mtk-eint library. Reported-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Tested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Closes: https://lore.kernel.org/all/43nd5jxpk7b7fv46frqlfjnqfh5jlpqsemeoakqzd4wdi3df6y@w7ycd3k5ezvn/ Fixes: 3ef9f71 ("pinctrl: mediatek: Add EINT support for multiple addresses") Cc: Hao Chang <ot_chhao.chang@mediatek.com> Cc: Qingliang Li <qingliang.li@mediatek.com> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/20250415112339.2385454-1-wenst@chromium.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 457d977 commit fe412e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/pinctrl/mediatek/pinctrl-mtk-common.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,13 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
10151015
if (!pctl->eint)
10161016
return -ENOMEM;
10171017

1018-
pctl->eint->base = devm_platform_ioremap_resource(pdev, 0);
1018+
pctl->eint->nbase = 1;
1019+
/* mtk-eint expects an array */
1020+
pctl->eint->base = devm_kzalloc(pctl->dev, sizeof(pctl->eint->base), GFP_KERNEL);
1021+
if (IS_ERR(pctl->eint->base))
1022+
return -ENOMEM;
1023+
1024+
pctl->eint->base[0] = devm_platform_ioremap_resource(pdev, 0);
10191025
if (IS_ERR(pctl->eint->base))
10201026
return PTR_ERR(pctl->eint->base);
10211027

0 commit comments

Comments
 (0)