* [v1,03/14] USB: musb: Re-use DEFINE_SHOW_ATTRIBUTE() macro
@ 2018-02-14 16:08 Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2018-02-14 16:08 UTC (permalink / raw)
To: Felipe Balbi, linux-usb, Greg Kroah-Hartman; +Cc: Andy Shevchenko, Bin Liu
...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.
Cc: Bin Liu <b-liu@ti.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/usb/musb/musb_debugfs.c | 13 +------------
1 file changed, 1 insertion(+), 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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [v1,03/14] USB: musb: Re-use DEFINE_SHOW_ATTRIBUTE() macro
@ 2018-02-15 14:46 Bin Liu
0 siblings, 0 replies; 2+ messages in thread
From: Bin Liu @ 2018-02-15 14:46 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Felipe Balbi, linux-usb, Greg Kroah-Hartman
On Wed, Feb 14, 2018 at 06:08:19PM +0200, Andy Shevchenko wrote:
> ...instead of open coding file operations followed by custom ->open()
> callbacks per each attribute.
>
> Cc: Bin Liu <b-liu@ti.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Bin Liu <b-liu@ti.com>
Regards,
-Bin.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-15 14:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-15 14:46 [v1,03/14] USB: musb: Re-use DEFINE_SHOW_ATTRIBUTE() macro Bin Liu
-- strict thread matches above, loose matches on Subject: below --
2018-02-14 16:08 Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).