Commit 78a9f4a3 authored by Yangtao Li's avatar Yangtao Li Committed by Mauro Carvalho Chehab

media: exynos4-is: convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 8866cfbf
...@@ -738,7 +738,7 @@ int fimc_is_hw_initialize(struct fimc_is *is) ...@@ -738,7 +738,7 @@ int fimc_is_hw_initialize(struct fimc_is *is)
return 0; return 0;
} }
static int fimc_is_log_show(struct seq_file *s, void *data) static int fimc_is_show(struct seq_file *s, void *data)
{ {
struct fimc_is *is = s->private; struct fimc_is *is = s->private;
const u8 *buf = is->memory.vaddr + FIMC_IS_DEBUG_REGION_OFFSET; const u8 *buf = is->memory.vaddr + FIMC_IS_DEBUG_REGION_OFFSET;
...@@ -752,17 +752,7 @@ static int fimc_is_log_show(struct seq_file *s, void *data) ...@@ -752,17 +752,7 @@ static int fimc_is_log_show(struct seq_file *s, void *data)
return 0; return 0;
} }
static int fimc_is_debugfs_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(fimc_is);
{
return single_open(file, fimc_is_log_show, inode->i_private);
}
static const struct file_operations fimc_is_debugfs_fops = {
.open = fimc_is_debugfs_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static void fimc_is_debugfs_remove(struct fimc_is *is) static void fimc_is_debugfs_remove(struct fimc_is *is)
{ {
...@@ -777,7 +767,7 @@ static int fimc_is_debugfs_create(struct fimc_is *is) ...@@ -777,7 +767,7 @@ static int fimc_is_debugfs_create(struct fimc_is *is)
is->debugfs_entry = debugfs_create_dir("fimc_is", NULL); is->debugfs_entry = debugfs_create_dir("fimc_is", NULL);
dentry = debugfs_create_file("fw_log", S_IRUGO, is->debugfs_entry, dentry = debugfs_create_file("fw_log", S_IRUGO, is->debugfs_entry,
is, &fimc_is_debugfs_fops); is, &fimc_is_fops);
if (!dentry) if (!dentry)
fimc_is_debugfs_remove(is); fimc_is_debugfs_remove(is);
......
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