summaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/debug.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-25 19:14:19 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-27 09:34:34 +0200
commit8f6c7c5a11ec599be524190122a56dbb730069a3 (patch)
treee9f1a8684fd07279d7d5a058229e745f5880d642 /drivers/usb/chipidea/debug.c
parentab00a41e73dc06b5a140af8c796d1bf03f6ec4ca (diff)
downloadlinux-8f6c7c5a11ec599be524190122a56dbb730069a3.tar.bz2
USB: chipidea: 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. Cc: Peter Chen <peter.chen@kernel.org> Link: https://lore.kernel.org/r/20210525171419.758146-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/debug.c')
-rw-r--r--drivers/usb/chipidea/debug.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index da5d18cf6840..faf6b078b6c4 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -342,26 +342,20 @@ DEFINE_SHOW_ATTRIBUTE(ci_registers);
*/
void dbg_create_files(struct ci_hdrc *ci)
{
- ci->debugfs = debugfs_create_dir(dev_name(ci->dev), usb_debug_root);
-
- debugfs_create_file("device", S_IRUGO, ci->debugfs, ci,
- &ci_device_fops);
- debugfs_create_file("port_test", S_IRUGO | S_IWUSR, ci->debugfs, ci,
- &ci_port_test_fops);
- debugfs_create_file("qheads", S_IRUGO, ci->debugfs, ci,
- &ci_qheads_fops);
- debugfs_create_file("requests", S_IRUGO, ci->debugfs, ci,
- &ci_requests_fops);
-
- if (ci_otg_is_fsm_mode(ci)) {
- debugfs_create_file("otg", S_IRUGO, ci->debugfs, ci,
- &ci_otg_fops);
- }
+ struct dentry *dir;
+
+ dir = debugfs_create_dir(dev_name(ci->dev), usb_debug_root);
+
+ debugfs_create_file("device", S_IRUGO, dir, ci, &ci_device_fops);
+ debugfs_create_file("port_test", S_IRUGO | S_IWUSR, dir, ci, &ci_port_test_fops);
+ debugfs_create_file("qheads", S_IRUGO, dir, ci, &ci_qheads_fops);
+ debugfs_create_file("requests", S_IRUGO, dir, ci, &ci_requests_fops);
+
+ if (ci_otg_is_fsm_mode(ci))
+ debugfs_create_file("otg", S_IRUGO, dir, ci, &ci_otg_fops);
- debugfs_create_file("role", S_IRUGO | S_IWUSR, ci->debugfs, ci,
- &ci_role_fops);
- debugfs_create_file("registers", S_IRUGO, ci->debugfs, ci,
- &ci_registers_fops);
+ debugfs_create_file("role", S_IRUGO | S_IWUSR, dir, ci, &ci_role_fops);
+ debugfs_create_file("registers", S_IRUGO, dir, ci, &ci_registers_fops);
}
/**
@@ -370,5 +364,5 @@ void dbg_create_files(struct ci_hdrc *ci)
*/
void dbg_remove_files(struct ci_hdrc *ci)
{
- debugfs_remove_recursive(ci->debugfs);
+ debugfs_remove(debugfs_lookup(dev_name(ci->dev), usb_debug_root));
}