All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [v1,08/14] USB: host: fhci: Re-use DEFINE_SHOW_ATTRIBUTE() macro
@ 2018-02-14 16:08 Andy Shevchenko
  0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2018-02-14 16:08 UTC (permalink / raw
  To: Felipe Balbi, linux-usb, Greg Kroah-Hartman; +Cc: Andy Shevchenko

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/host/fhci-dbg.c | 26 ++------------------------
 1 file 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)
 
 	return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(fhci_dfs_regs);
 
 static int fhci_dfs_irq_stat_show(struct seq_file *s, void *v)
 {
@@ -75,30 +76,7 @@ static int fhci_dfs_irq_stat_show(struct seq_file *s, void *v)
 
 	return 0;
 }
-
-static int fhci_dfs_regs_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, fhci_dfs_regs_show, inode->i_private);
-}
-
-static int fhci_dfs_irq_stat_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, fhci_dfs_irq_stat_show, inode->i_private);
-}
-
-static const struct file_operations fhci_dfs_regs_fops = {
-	.open = fhci_dfs_regs_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static const struct file_operations fhci_dfs_irq_stat_fops = {
-	.open = fhci_dfs_irq_stat_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(fhci_dfs_irq_stat);
 
 void fhci_dfs_create(struct fhci_hcd *fhci)
 {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-14 16:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 16:08 [v1,08/14] USB: host: fhci: Re-use DEFINE_SHOW_ATTRIBUTE() macro Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.