diff options
author | Tony Lindgren <tony@atomide.com> | 2012-01-20 08:17:22 -0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-01-24 23:03:02 +0100 |
commit | 0215716083cac67ff7ea3e3efdc9943bdb462274 (patch) | |
tree | 5d3f28f6aa09717833d5f60e5f7cb148e4a9d2e1 /drivers/pinctrl/core.c | |
parent | f9d41d7cb5a3a4fe9585d47e518d779d2aef8c94 (diff) | |
download | op-kernel-dev-0215716083cac67ff7ea3e3efdc9943bdb462274.zip op-kernel-dev-0215716083cac67ff7ea3e3efdc9943bdb462274.tar.gz |
pinctrl: free debugfs entries when unloading a pinmux driver
We were not cleaning up properly after unloading a pinmux
driver compiled as module.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/core.c')
-rw-r--r-- | drivers/pinctrl/core.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 569bdb3..d9d35fc 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -510,10 +510,12 @@ static struct dentry *debugfs_root; static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) { - static struct dentry *device_root; + struct dentry *device_root; device_root = debugfs_create_dir(dev_name(pctldev->dev), debugfs_root); + pctldev->device_root = device_root; + if (IS_ERR(device_root) || !device_root) { pr_warn("failed to create debugfs directory for %s\n", dev_name(pctldev->dev)); @@ -529,6 +531,11 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) pinconf_init_device_debugfs(device_root, pctldev); } +static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) +{ + debugfs_remove_recursive(pctldev->device_root); +} + static void pinctrl_init_debugfs(void) { debugfs_root = debugfs_create_dir("pinctrl", NULL); @@ -553,6 +560,10 @@ static void pinctrl_init_debugfs(void) { } +static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) +{ +} + #endif /** @@ -641,6 +652,7 @@ void pinctrl_unregister(struct pinctrl_dev *pctldev) if (pctldev == NULL) return; + pinctrl_remove_device_debugfs(pctldev); pinmux_unhog_maps(pctldev); /* TODO: check that no pinmuxes are still active? */ mutex_lock(&pinctrldev_list_mutex); |