aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-nomadik.c
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-11-23 10:06:00 -0500
committerStephen Boyd <sboyd@kernel.org>2018-11-28 14:13:18 -0800
commit9579346ecf761303fc85be908d1ad3d947fac354 (patch)
tree5f56e23554e025936ebcaba52681556c68dd2744 /drivers/clk/clk-nomadik.c
parentLinux 4.20-rc1 (diff)
downloadlinux-dev-9579346ecf761303fc85be908d1ad3d947fac354.tar.xz
linux-dev-9579346ecf761303fc85be908d1ad3d947fac354.zip
clk: nomadik: Change to use DEFINE_SHOW_ATTRIBUTE macro
Use macro to simplify the code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> [sboyd@kernel.org: Rename show function to keep compiling] Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-nomadik.c')
-rw-r--r--drivers/clk/clk-nomadik.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
index 84a24875c629..a95aa96f4a68 100644
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -455,7 +455,7 @@ static const char * const src_clk_names[] = {
"RNGCCLK ",
};
-static int nomadik_src_clk_show(struct seq_file *s, void *what)
+static int nomadik_src_clk_debugfs_show(struct seq_file *s, void *what)
{
int i;
u32 src_pcksr0 = readl(src_base + SRC_PCKSR0);
@@ -479,17 +479,7 @@ static int nomadik_src_clk_show(struct seq_file *s, void *what)
return 0;
}
-static int nomadik_src_clk_open(struct inode *inode, struct file *file)
-{
- return single_open(file, nomadik_src_clk_show, NULL);
-}
-
-static const struct file_operations nomadik_src_clk_debugfs_ops = {
- .open = nomadik_src_clk_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(nomadik_src_clk_debugfs);
static int __init nomadik_src_clk_init_debugfs(void)
{
@@ -499,7 +489,7 @@ static int __init nomadik_src_clk_init_debugfs(void)
src_pcksr0_boot = readl(src_base + SRC_PCKSR0);
src_pcksr1_boot = readl(src_base + SRC_PCKSR1);
debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO,
- NULL, NULL, &nomadik_src_clk_debugfs_ops);
+ NULL, NULL, &nomadik_src_clk_debugfs_fops);
return 0;
}
device_initcall(nomadik_src_clk_init_debugfs);