aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2020-02-28 15:42:14 +0000
committerLinus Walleij <linus.walleij@linaro.org>2020-02-29 00:34:23 +0100
commit3567ee83c413a939d45fea2e2f2c4968a9f81460 (patch)
tree1bf6c2d2c190a10812b1bc78fce2cd5c6751d4f5 /drivers/pinctrl
parentpinctrl: core: Remove extra kref_get which blocks hogs being freed (diff)
downloadwireguard-linux-3567ee83c413a939d45fea2e2f2c4968a9f81460.tar.xz
wireguard-linux-3567ee83c413a939d45fea2e2f2c4968a9f81460.zip
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>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/cirrus/pinctrl-madera-core.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
index 7b6409ef553c..dce2626384a9 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c
+++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
@@ -1073,13 +1073,26 @@ static int madera_pin_probe(struct platform_device *pdev)
return ret;
}
+ platform_set_drvdata(pdev, priv);
+
dev_dbg(priv->dev, "pinctrl probed ok\n");
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 = {
.probe = madera_pin_probe,
+ .remove = madera_pin_remove,
.driver = {
.name = "madera-pinctrl",
},