summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-20 13:13:08 -0500
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-12-20 13:13:08 -0500
commit452f2d4934d23f32cd9246bc52cf2c0b80560e2f (patch)
tree46c237e96a279e5c3eaabb75e27335ed3d1ed452 /drivers/video
parente0f5628bf2c163a815bb728fa7899e8dc0a4a82c (diff)
fbdev: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Cc: Fengguang Wu <fengguang.wu@intel.com> Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/omap2/omapfb/dss/core.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c
index a5e58a829ea0..b4bcf3a4a647 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c
@@ -99,24 +99,14 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
99} 99}
100 100
101#if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS) 101#if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS)
102static int dss_debug_show(struct seq_file *s, void *unused) 102static int dss_show(struct seq_file *s, void *unused)
103{ 103{
104 void (*func)(struct seq_file *) = s->private; 104 void (*func)(struct seq_file *) = s->private;
105 func(s); 105 func(s);
106 return 0; 106 return 0;
107} 107}
108 108
109static int dss_debug_open(struct inode *inode, struct file *file) 109DEFINE_SHOW_ATTRIBUTE(dss);
110{
111 return single_open(file, dss_debug_show, inode->i_private);
112}
113
114static const struct file_operations dss_debug_fops = {
115 .open = dss_debug_open,
116 .read = seq_read,
117 .llseek = seq_lseek,
118 .release = single_release,
119};
120 110
121static struct dentry *dss_debugfs_dir; 111static struct dentry *dss_debugfs_dir;
122 112
@@ -130,7 +120,7 @@ static int dss_initialize_debugfs(void)
130 } 120 }
131 121
132 debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir, 122 debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
133 &dss_debug_dump_clocks, &dss_debug_fops); 123 &dss_debug_dump_clocks, &dss_fops);
134 124
135 return 0; 125 return 0;
136} 126}
@@ -145,7 +135,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
145 struct dentry *d; 135 struct dentry *d;
146 136
147 d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, 137 d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir,
148 write, &dss_debug_fops); 138 write, &dss_fops);
149 139
150 return PTR_ERR_OR_ZERO(d); 140 return PTR_ERR_OR_ZERO(d);
151} 141}