提交 0f60203d 编写于 作者: G Greg Kroah-Hartman

USB: fotg210-hcd: remove dentry storage for debugfs file

There is no need to store the dentry pointer for a debugfs file that we
only use to remove it when the device goes away.  debugfs can do the
lookup for us instead, saving us some trouble, and making things smaller
overall.

Link: https://lore.kernel.org/r/20210525172534.848775-1-gregkh@linuxfoundation.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 8efd88f9
...@@ -850,7 +850,6 @@ static inline void create_debug_files(struct fotg210_hcd *fotg210) ...@@ -850,7 +850,6 @@ static inline void create_debug_files(struct fotg210_hcd *fotg210)
struct dentry *root; struct dentry *root;
root = debugfs_create_dir(bus->bus_name, fotg210_debug_root); root = debugfs_create_dir(bus->bus_name, fotg210_debug_root);
fotg210->debug_dir = root;
debugfs_create_file("async", S_IRUGO, root, bus, &debug_async_fops); debugfs_create_file("async", S_IRUGO, root, bus, &debug_async_fops);
debugfs_create_file("periodic", S_IRUGO, root, bus, debugfs_create_file("periodic", S_IRUGO, root, bus,
...@@ -861,7 +860,9 @@ static inline void create_debug_files(struct fotg210_hcd *fotg210) ...@@ -861,7 +860,9 @@ static inline void create_debug_files(struct fotg210_hcd *fotg210)
static inline void remove_debug_files(struct fotg210_hcd *fotg210) static inline void remove_debug_files(struct fotg210_hcd *fotg210)
{ {
debugfs_remove_recursive(fotg210->debug_dir); struct usb_bus *bus = &fotg210_to_hcd(fotg210)->self;
debugfs_remove(debugfs_lookup(bus->bus_name, fotg210_debug_root));
} }
/* handshake - spin reading hc until handshake completes or fails /* handshake - spin reading hc until handshake completes or fails
......
...@@ -184,9 +184,6 @@ struct fotg210_hcd { /* one per controller */ ...@@ -184,9 +184,6 @@ struct fotg210_hcd { /* one per controller */
/* silicon clock */ /* silicon clock */
struct clk *pclk; struct clk *pclk;
/* debug files */
struct dentry *debug_dir;
}; };
/* convert between an HCD pointer and the corresponding FOTG210_HCD */ /* convert between an HCD pointer and the corresponding FOTG210_HCD */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册