mirror of
https://github.com/torvalds/linux.git
synced 2026-12-04 04:14:24 +00:00
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 <[email protected]>
Tested-by: Uwe Kleine-König <[email protected]>
Closes: https://lore.kernel.org/all/43nd5jxpk7b7fv46frqlfjnqfh5jlpqsemeoakqzd4wdi3df6y@w7ycd3k5ezvn/
Fixes: 3ef9f710ef ("pinctrl: mediatek: Add EINT support for multiple addresses")
Cc: Hao Chang <[email protected]>
Cc: Qingliang Li <[email protected]>
Signed-off-by: Chen-Yu Tsai <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
committed by
Linus Walleij
parent
457d9772e8
commit
fe412e3a6c
@@ -1015,7 +1015,13 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
|
||||
if (!pctl->eint)
|
||||
return -ENOMEM;
|
||||
|
||||
pctl->eint->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
pctl->eint->nbase = 1;
|
||||
/* mtk-eint expects an array */
|
||||
pctl->eint->base = devm_kzalloc(pctl->dev, sizeof(pctl->eint->base), GFP_KERNEL);
|
||||
if (IS_ERR(pctl->eint->base))
|
||||
return -ENOMEM;
|
||||
|
||||
pctl->eint->base[0] = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(pctl->eint->base))
|
||||
return PTR_ERR(pctl->eint->base);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user