提交 94d0fb15 编写于 作者: Y Yangtao Li 提交者: David S. Miller

ide: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: NYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a51921c0
......@@ -614,18 +614,7 @@ static int ide_drivers_show(struct seq_file *s, void *p)
return 0;
}
static int ide_drivers_open(struct inode *inode, struct file *file)
{
return single_open(file, &ide_drivers_show, NULL);
}
static const struct file_operations ide_drivers_operations = {
.owner = THIS_MODULE,
.open = ide_drivers_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
DEFINE_SHOW_ATTRIBUTE(ide_drivers);
void proc_ide_create(void)
{
......@@ -634,7 +623,7 @@ void proc_ide_create(void)
if (!proc_ide_root)
return;
proc_create("drivers", 0, proc_ide_root, &ide_drivers_operations);
proc_create("drivers", 0, proc_ide_root, &ide_drivers_fops);
}
void proc_ide_destroy(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册