diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-02-14 19:08:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-09 20:27:55 +0300 |
commit | efb85c4d24b4a551ce9bab5b4d2d6c54c9882d90 (patch) | |
tree | abf0cbd55081ad5766461af3d6e7600346c70a27 /drivers/usb/musb/musb_debugfs.c | |
parent | fd9197ef4438a4696e13305af967b9d9ace7125d (diff) | |
download | linux-efb85c4d24b4a551ce9bab5b4d2d6c54c9882d90.tar.xz |
USB: musb: Re-use DEFINE_SHOW_ATTRIBUTE() macro
...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>
Diffstat (limited to 'drivers/usb/musb/musb_debugfs.c')
-rw-r--r-- | drivers/usb/musb/musb_debugfs.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c index 7cf5a1bbdaff..025b2c8630df 100644 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c @@ -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) { @@ -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); |