Commit a5ccec12 authored by Liu Shixin's avatar Liu Shixin Committed by Greg Kroah-Hartman

bus: mvebu-mbus: use DEFINE_SHOW_ATTRIBUTE to simplify mvebu_{sdram/devs}_debug

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
Link: https://lore.kernel.org/r/20220916141244.2174005-1-liushixin2@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 711898b1
...@@ -466,18 +466,7 @@ static int mvebu_sdram_debug_show(struct seq_file *seq, void *v) ...@@ -466,18 +466,7 @@ static int mvebu_sdram_debug_show(struct seq_file *seq, void *v)
struct mvebu_mbus_state *mbus = &mbus_state; struct mvebu_mbus_state *mbus = &mbus_state;
return mbus->soc->show_cpu_target(mbus, seq, v); return mbus->soc->show_cpu_target(mbus, seq, v);
} }
DEFINE_SHOW_ATTRIBUTE(mvebu_sdram_debug);
static int mvebu_sdram_debug_open(struct inode *inode, struct file *file)
{
return single_open(file, mvebu_sdram_debug_show, inode->i_private);
}
static const struct file_operations mvebu_sdram_debug_fops = {
.open = mvebu_sdram_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int mvebu_devs_debug_show(struct seq_file *seq, void *v) static int mvebu_devs_debug_show(struct seq_file *seq, void *v)
{ {
...@@ -516,18 +505,7 @@ static int mvebu_devs_debug_show(struct seq_file *seq, void *v) ...@@ -516,18 +505,7 @@ static int mvebu_devs_debug_show(struct seq_file *seq, void *v)
return 0; return 0;
} }
DEFINE_SHOW_ATTRIBUTE(mvebu_devs_debug);
static int mvebu_devs_debug_open(struct inode *inode, struct file *file)
{
return single_open(file, mvebu_devs_debug_show, inode->i_private);
}
static const struct file_operations mvebu_devs_debug_fops = {
.open = mvebu_devs_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* /*
* SoC-specific functions and definitions * SoC-specific functions and definitions
......
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