Skip to content

Commit 3567ee8

Browse files
charleskeepaxlinusw
authored andcommitted
pinctrl: madera: Add missing call to pinctrl_unregister_mappings
pinctrl_register_mappings is called in the pdata case, however a call to pinctrl_unregister_mappings is missing causing the mappings to be leaked on driver unbind. Add the missing call to correct this issue. Signed-off-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent aafd56f commit 3567ee8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/pinctrl/cirrus/pinctrl-madera-core.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,13 +1073,26 @@ static int madera_pin_probe(struct platform_device *pdev)
10731073
return ret;
10741074
}
10751075

1076+
platform_set_drvdata(pdev, priv);
1077+
10761078
dev_dbg(priv->dev, "pinctrl probed ok\n");
10771079

10781080
return 0;
10791081
}
10801082

1083+
static int madera_pin_remove(struct platform_device *pdev)
1084+
{
1085+
struct madera_pin_private *priv = platform_get_drvdata(pdev);
1086+
1087+
if (priv->madera->pdata.gpio_configs)
1088+
pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs);
1089+
1090+
return 0;
1091+
}
1092+
10811093
static struct platform_driver madera_pin_driver = {
10821094
.probe = madera_pin_probe,
1095+
.remove = madera_pin_remove,
10831096
.driver = {
10841097
.name = "madera-pinctrl",
10851098
},

0 commit comments

Comments
 (0)