Skip to content

Commit

Permalink
ide: Change to use DEFINE_SHOW_ATTRIBUTE macro
Browse files Browse the repository at this point in the history
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yangtao Li authored and David S. Miller committed Dec 3, 2018
1 parent a51921c commit 94d0fb1
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions drivers/ide/ide-proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down

0 comments on commit 94d0fb1

Please sign in to comment.