diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-02-14 11:08:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-09 12:31:25 -0500 |
commit | 513f6750c433c49856490e341a9610d502607393 (patch) | |
tree | 53a94987a4134a80bcd2574376089a66dc740503 | |
parent | 35a7e0a2efe6714f68c92fb03e760264929f6dc5 (diff) |
USB: host: fhci: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/fhci-dbg.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/usb/host/fhci-dbg.c b/drivers/usb/host/fhci-dbg.c index fafa91189e45..ebf9bb219f75 100644 --- a/drivers/usb/host/fhci-dbg.c +++ b/drivers/usb/host/fhci-dbg.c | |||
@@ -55,6 +55,7 @@ static int fhci_dfs_regs_show(struct seq_file *s, void *v) | |||
55 | 55 | ||
56 | return 0; | 56 | return 0; |
57 | } | 57 | } |
58 | DEFINE_SHOW_ATTRIBUTE(fhci_dfs_regs); | ||
58 | 59 | ||
59 | static int fhci_dfs_irq_stat_show(struct seq_file *s, void *v) | 60 | static int fhci_dfs_irq_stat_show(struct seq_file *s, void *v) |
60 | { | 61 | { |
@@ -75,30 +76,7 @@ static int fhci_dfs_irq_stat_show(struct seq_file *s, void *v) | |||
75 | 76 | ||
76 | return 0; | 77 | return 0; |
77 | } | 78 | } |
78 | 79 | DEFINE_SHOW_ATTRIBUTE(fhci_dfs_irq_stat); | |
79 | static int fhci_dfs_regs_open(struct inode *inode, struct file *file) | ||
80 | { | ||
81 | return single_open(file, fhci_dfs_regs_show, inode->i_private); | ||
82 | } | ||
83 | |||
84 | static int fhci_dfs_irq_stat_open(struct inode *inode, struct file *file) | ||
85 | { | ||
86 | return single_open(file, fhci_dfs_irq_stat_show, inode->i_private); | ||
87 | } | ||
88 | |||
89 | static const struct file_operations fhci_dfs_regs_fops = { | ||
90 | .open = fhci_dfs_regs_open, | ||
91 | .read = seq_read, | ||
92 | .llseek = seq_lseek, | ||
93 | .release = single_release, | ||
94 | }; | ||
95 | |||
96 | static const struct file_operations fhci_dfs_irq_stat_fops = { | ||
97 | .open = fhci_dfs_irq_stat_open, | ||
98 | .read = seq_read, | ||
99 | .llseek = seq_lseek, | ||
100 | .release = single_release, | ||
101 | }; | ||
102 | 80 | ||
103 | void fhci_dfs_create(struct fhci_hcd *fhci) | 81 | void fhci_dfs_create(struct fhci_hcd *fhci) |
104 | { | 82 | { |