summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-05 17:33:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-12 12:38:41 +0100
commit9e412c66a8a24fabad97b706132ee270db2e4c8e (patch)
tree6ffc06f4ba81dc42389627385c81481ce4bdbb64 /drivers/usb
parentMerge tag 'usb-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/ba... (diff)
downloadlinux-9e412c66a8a24fabad97b706132ee270db2e4c8e.tar.xz
linux-9e412c66a8a24fabad97b706132ee270db2e4c8e.zip
usb: host: isp1362-hcd: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/isp1362-hcd.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index b21c386e6a46..28bf8bfb091e 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -2159,25 +2159,15 @@ static int isp1362_show(struct seq_file *s, void *unused)
return 0;
}
-
-static int isp1362_open(struct inode *inode, struct file *file)
-{
- return single_open(file, isp1362_show, inode);
-}
-
-static const struct file_operations debug_ops = {
- .open = isp1362_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(isp1362);
/* expect just one isp1362_hcd per system */
static void create_debug_file(struct isp1362_hcd *isp1362_hcd)
{
isp1362_hcd->debug_file = debugfs_create_file("isp1362", S_IRUGO,
usb_debug_root,
- isp1362_hcd, &debug_ops);
+ isp1362_hcd,
+ &isp1362_fops);
}
static void remove_debug_file(struct isp1362_hcd *isp1362_hcd)