Skip to content

Commit

Permalink
USB: musb: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Browse files Browse the repository at this point in the history
...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed Mar 9, 2018
1 parent fd9197e commit efb85c4
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/usb/musb/musb_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ static int musb_regdump_show(struct seq_file *s, void *unused)
pm_runtime_put_autosuspend(musb->controller);
return 0;
}

static int musb_regdump_open(struct inode *inode, struct file *file)
{
return single_open(file, musb_regdump_show, inode->i_private);
}
DEFINE_SHOW_ATTRIBUTE(musb_regdump);

static int musb_test_mode_show(struct seq_file *s, void *unused)
{
Expand Down Expand Up @@ -161,13 +157,6 @@ static int musb_test_mode_show(struct seq_file *s, void *unused)
return 0;
}

static const struct file_operations musb_regdump_fops = {
.open = musb_regdump_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static int musb_test_mode_open(struct inode *inode, struct file *file)
{
return single_open(file, musb_test_mode_show, inode->i_private);
Expand Down

0 comments on commit efb85c4

Please sign in to comment.