diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-02-16 11:14:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-10 09:37:15 +0100 |
commit | 9c174b57c98e78310a15cf9808cf417fa4a65d9b (patch) | |
tree | a13baad7d4ba144f89fef123412064a14a8132ef /drivers | |
parent | 70be046404efd82ab75595a4fb73cb751e2e1372 (diff) | |
download | linux-9c174b57c98e78310a15cf9808cf417fa4a65d9b.tar.bz2 |
USB: core: no need to save usb_devices_root
There is no need to save the usb_devices debugfs file as we only need it
when removing it, so have the debugfs code look it up when it is needed
instead, saving the storage.
Link: https://lore.kernel.org/r/YCubCA/trHAF7PtF@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/usb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 8f07b0516100..829dc8e85b00 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -950,17 +950,15 @@ static struct notifier_block usb_bus_nb = { .notifier_call = usb_bus_notify, }; -static struct dentry *usb_devices_root; - static void usb_debugfs_init(void) { - usb_devices_root = debugfs_create_file("devices", 0444, usb_debug_root, - NULL, &usbfs_devices_fops); + debugfs_create_file("devices", 0444, usb_debug_root, NULL, + &usbfs_devices_fops); } static void usb_debugfs_cleanup(void) { - debugfs_remove(usb_devices_root); + debugfs_remove(debugfs_lookup("devices", usb_debug_root)); } /* |