Commit 3567ee83 authored by Charles Keepax's avatar Charles Keepax Committed by Linus Walleij

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: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200228154214.13916-1-ckeepax@opensource.cirrus.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent aafd56fc
...@@ -1073,13 +1073,26 @@ static int madera_pin_probe(struct platform_device *pdev) ...@@ -1073,13 +1073,26 @@ static int madera_pin_probe(struct platform_device *pdev)
return ret; return ret;
} }
platform_set_drvdata(pdev, priv);
dev_dbg(priv->dev, "pinctrl probed ok\n"); dev_dbg(priv->dev, "pinctrl probed ok\n");
return 0; return 0;
} }
static int madera_pin_remove(struct platform_device *pdev)
{
struct madera_pin_private *priv = platform_get_drvdata(pdev);
if (priv->madera->pdata.gpio_configs)
pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs);
return 0;
}
static struct platform_driver madera_pin_driver = { static struct platform_driver madera_pin_driver = {
.probe = madera_pin_probe, .probe = madera_pin_probe,
.remove = madera_pin_remove,
.driver = { .driver = {
.name = "madera-pinctrl", .name = "madera-pinctrl",
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment