Commit 452f2d49 authored by Yangtao Li's avatar Yangtao Li Committed by Bartlomiej Zolnierkiewicz

fbdev: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent e0f5628b
...@@ -99,24 +99,14 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput) ...@@ -99,24 +99,14 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
} }
#if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS) #if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS)
static int dss_debug_show(struct seq_file *s, void *unused) static int dss_show(struct seq_file *s, void *unused)
{ {
void (*func)(struct seq_file *) = s->private; void (*func)(struct seq_file *) = s->private;
func(s); func(s);
return 0; return 0;
} }
static int dss_debug_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(dss);
{
return single_open(file, dss_debug_show, inode->i_private);
}
static const struct file_operations dss_debug_fops = {
.open = dss_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct dentry *dss_debugfs_dir; static struct dentry *dss_debugfs_dir;
...@@ -130,7 +120,7 @@ static int dss_initialize_debugfs(void) ...@@ -130,7 +120,7 @@ static int dss_initialize_debugfs(void)
} }
debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir, debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
&dss_debug_dump_clocks, &dss_debug_fops); &dss_debug_dump_clocks, &dss_fops);
return 0; return 0;
} }
...@@ -145,7 +135,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) ...@@ -145,7 +135,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
struct dentry *d; struct dentry *d;
d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir,
write, &dss_debug_fops); write, &dss_fops);
return PTR_ERR_OR_ZERO(d); return PTR_ERR_OR_ZERO(d);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment