From: Tony Lindgren <tony@atomide.com>
To: linux-kernel@vger.kernel.org
Cc: Stephen Warren <swarren@nvidia.com>,
Linus Walleij <linus.walleij@stericsson.com>,
Barry Song <21cnbao@gmail.com>,
Haojian Zhuang <haojian.zhuang@marvell.com>,
Grant Likely <grant.likely@secretlab.ca>,
Thomas Abraham <thomas.abraham@linaro.org>,
Rajendra Nayak <rajendra.nayak@linaro.org>,
Dong Aisheng <dong.aisheng@linaro.org>,
Shawn Guo <shawn.guo@freescale.com>
Subject: [PATCH 1/4] pinctrl: Free debugfs entries when unloading a pinmux driver
Date: Fri, 20 Jan 2012 08:17:22 -0800 [thread overview]
Message-ID: <20120120161722.21955.90415.stgit@kaulin.local> (raw)
In-Reply-To: <20120120161610.21955.25082.stgit@kaulin.local>
Free debugfs entries when unloading a pinmux driver
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/pinctrl/core.c | 14 +++++++++++++-
drivers/pinctrl/core.h | 3 +++
2 files changed, 16 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);
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 177a331..cfa86da 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -41,6 +41,9 @@ struct pinctrl_dev {
struct device *dev;
struct module *owner;
void *driver_data;
+#ifdef CONFIG_DEBUG_FS
+ struct dentry *device_root;
+#endif
#ifdef CONFIG_PINMUX
struct mutex pinmux_hogs_lock;
struct list_head pinmux_hogs;
next prev parent reply other threads:[~2012-01-20 16:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-20 16:17 [PATCH 0/4] Some pinctrl fixes for pinmux modules Tony Lindgren
2012-01-20 16:17 ` Tony Lindgren [this message]
2012-01-24 21:51 ` [PATCH 1/4] pinctrl: Free debugfs entries when unloading a pinmux driver Linus Walleij
2012-01-20 16:17 ` [PATCH 2/4] pinctrl: Fix pinmux_hog_maps when ctrl_dev_name is not set Tony Lindgren
2012-01-20 16:57 ` Stephen Warren
2012-01-20 17:39 ` Tony Lindgren
2012-01-25 0:23 ` Tony Lindgren
2012-01-25 0:47 ` Stephen Warren
2012-01-26 11:51 ` Linus Walleij
2012-01-20 16:17 ` [PATCH 3/4] pinctrl: Add checks for empty names in pinmux_search_function Tony Lindgren
2012-01-20 17:00 ` Stephen Warren
2012-01-20 17:41 ` Tony Lindgren
2012-01-25 22:08 ` Tony Lindgren
2012-01-26 13:14 ` Linus Walleij
2012-01-20 16:17 ` [PATCH 4/4] pinctrl: Fix some pinmux typos Tony Lindgren
2012-01-24 21:54 ` Linus Walleij
2012-01-24 21:55 ` [PATCH 0/4] Some pinctrl fixes for pinmux modules Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120120161722.21955.90415.stgit@kaulin.local \
--to=tony@atomide.com \
--cc=21cnbao@gmail.com \
--cc=dong.aisheng@linaro.org \
--cc=grant.likely@secretlab.ca \
--cc=haojian.zhuang@marvell.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rajendra.nayak@linaro.org \
--cc=shawn.guo@freescale.com \
--cc=swarren@nvidia.com \
--cc=thomas.abraham@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome