summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorPeter De Schrijver <pdeschrijver@nvidia.com>2014-06-26 18:00:53 +0300
committerMike Turquette <mturquette@linaro.org>2014-07-02 16:15:55 -0700
commitfb2b3c9f68574738c70b9df5fc2bea40f91dd8be (patch)
tree26e0c80d9502c0ae0a473c0e24832b9d218d1467 /drivers/clk
parent89ed7e6e68c176e77c7e2677551c91d4185fe0b4 (diff)
downloadlinux-0-day-fb2b3c9f68574738c70b9df5fc2bea40f91dd8be.tar.gz
linux-0-day-fb2b3c9f68574738c70b9df5fc2bea40f91dd8be.tar.xz
clk: define and export clk_debugs_add_file
Define and export a new function clk_debugs_add_file which adds a file to a existing clock's debugfs directory. This can be used by clock providers to add debugfs entries which are not related to a specific clock type. Examples include the ability to measure the rate of a clock. It can also be used by modules to create new debugfs entries. This is useful if you want to expose features for testing which can potentially cause system instability such as allowing to change a clock's rate from userspace. Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 958967d141eec..9ad3970504719 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -358,6 +358,18 @@ static void clk_debug_unregister(struct clk *clk)
debugfs_remove_recursive(clk->dentry);
}
+struct dentry *clk_debugfs_add_file(struct clk *clk, char *name, umode_t mode,
+ void *data, const struct file_operations *fops)
+{
+ struct dentry *d = NULL;
+
+ if (clk->dentry)
+ d = debugfs_create_file(name, mode, clk->dentry, data, fops);
+
+ return d;
+}
+EXPORT_SYMBOL_GPL(clk_debugfs_add_file);
+
/**
* clk_debug_init - lazily create the debugfs clk tree visualization
*