diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-29 18:30:59 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-31 13:54:22 +0300 |
commit | b708692dda1edfc357dceca8219c79466778b777 (patch) | |
tree | 3eaba7fd81c2b20f83dbe3974ae19deeaf0850de /drivers/usb | |
parent | a61b75d10882b3732b6dba29c10b1a54ffb36819 (diff) | |
download | linux-b708692dda1edfc357dceca8219c79466778b777.tar.xz |
USB: core: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the
return value. The function can work or not, but the code logic should
never do something different based on this.
Cc: Johan Hovold <johan@kernel.org>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/usb.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 0adb6345ff2e..623be3174fb3 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -1167,30 +1167,16 @@ static struct notifier_block usb_bus_nb = { struct dentry *usb_debug_root; EXPORT_SYMBOL_GPL(usb_debug_root); -static struct dentry *usb_debug_devices; - -static int usb_debugfs_init(void) +static void usb_debugfs_init(void) { usb_debug_root = debugfs_create_dir("usb", NULL); - if (!usb_debug_root) - return -ENOENT; - - usb_debug_devices = debugfs_create_file("devices", 0444, - usb_debug_root, NULL, - &usbfs_devices_fops); - if (!usb_debug_devices) { - debugfs_remove(usb_debug_root); - usb_debug_root = NULL; - return -ENOENT; - } - - return 0; + debugfs_create_file("devices", 0444, usb_debug_root, NULL, + &usbfs_devices_fops); } static void usb_debugfs_cleanup(void) { - debugfs_remove(usb_debug_devices); - debugfs_remove(usb_debug_root); + debugfs_remove_recursive(usb_debug_root); } /* @@ -1205,9 +1191,7 @@ static int __init usb_init(void) } usb_init_pool_max(); - retval = usb_debugfs_init(); - if (retval) - goto out; + usb_debugfs_init(); usb_acpi_register(); retval = bus_register(&usb_bus_type); |