aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-02-14 11:08:24 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-09 12:31:25 -0500
commit513f6750c433c49856490e341a9610d502607393 (patch)
tree53a94987a4134a80bcd2574376089a66dc740503
parent35a7e0a2efe6714f68c92fb03e760264929f6dc5 (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.c26
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}
58DEFINE_SHOW_ATTRIBUTE(fhci_dfs_regs);
58 59
59static int fhci_dfs_irq_stat_show(struct seq_file *s, void *v) 60static 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 79DEFINE_SHOW_ATTRIBUTE(fhci_dfs_irq_stat);
79static 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
84static 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
89static 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
96static 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
103void fhci_dfs_create(struct fhci_hcd *fhci) 81void fhci_dfs_create(struct fhci_hcd *fhci)
104{ 82{