Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200228154214.13916-1-ckeepax@opensource.cirrus.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Charles Keepax and committed by
Linus Walleij
3567ee83 aafd56fc

+13
+13
drivers/pinctrl/cirrus/pinctrl-madera-core.c
··· 1073 1073 return ret; 1074 1074 } 1075 1075 1076 + platform_set_drvdata(pdev, priv); 1077 + 1076 1078 dev_dbg(priv->dev, "pinctrl probed ok\n"); 1079 + 1080 + return 0; 1081 + } 1082 + 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); 1077 1089 1078 1090 return 0; 1079 1091 } 1080 1092 1081 1093 static struct platform_driver madera_pin_driver = { 1082 1094 .probe = madera_pin_probe, 1095 + .remove = madera_pin_remove, 1083 1096 .driver = { 1084 1097 .name = "madera-pinctrl", 1085 1098 },