Commit b8fc7743 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: ehci-hcd: 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: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2ee12724
...@@ -1028,29 +1028,15 @@ static inline void create_debug_files(struct ehci_hcd *ehci) ...@@ -1028,29 +1028,15 @@ static inline void create_debug_files(struct ehci_hcd *ehci)
struct usb_bus *bus = &ehci_to_hcd(ehci)->self; struct usb_bus *bus = &ehci_to_hcd(ehci)->self;
ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root); ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root);
if (!ehci->debug_dir)
return;
if (!debugfs_create_file("async", S_IRUGO, ehci->debug_dir, bus, debugfs_create_file("async", S_IRUGO, ehci->debug_dir, bus,
&debug_async_fops)) &debug_async_fops);
goto file_error; debugfs_create_file("bandwidth", S_IRUGO, ehci->debug_dir, bus,
&debug_bandwidth_fops);
if (!debugfs_create_file("bandwidth", S_IRUGO, ehci->debug_dir, bus, debugfs_create_file("periodic", S_IRUGO, ehci->debug_dir, bus,
&debug_bandwidth_fops)) &debug_periodic_fops);
goto file_error; debugfs_create_file("registers", S_IRUGO, ehci->debug_dir, bus,
&debug_registers_fops);
if (!debugfs_create_file("periodic", S_IRUGO, ehci->debug_dir, bus,
&debug_periodic_fops))
goto file_error;
if (!debugfs_create_file("registers", S_IRUGO, ehci->debug_dir, bus,
&debug_registers_fops))
goto file_error;
return;
file_error:
debugfs_remove_recursive(ehci->debug_dir);
} }
static inline void remove_debug_files(struct ehci_hcd *ehci) static inline void remove_debug_files(struct ehci_hcd *ehci)
......
...@@ -1311,10 +1311,6 @@ static int __init ehci_hcd_init(void) ...@@ -1311,10 +1311,6 @@ static int __init ehci_hcd_init(void)
#ifdef CONFIG_DYNAMIC_DEBUG #ifdef CONFIG_DYNAMIC_DEBUG
ehci_debug_root = debugfs_create_dir("ehci", usb_debug_root); ehci_debug_root = debugfs_create_dir("ehci", usb_debug_root);
if (!ehci_debug_root) {
retval = -ENOENT;
goto err_debug;
}
#endif #endif
#ifdef PLATFORM_DRIVER #ifdef PLATFORM_DRIVER
...@@ -1361,7 +1357,6 @@ static int __init ehci_hcd_init(void) ...@@ -1361,7 +1357,6 @@ static int __init ehci_hcd_init(void)
#ifdef CONFIG_DYNAMIC_DEBUG #ifdef CONFIG_DYNAMIC_DEBUG
debugfs_remove(ehci_debug_root); debugfs_remove(ehci_debug_root);
ehci_debug_root = NULL; ehci_debug_root = NULL;
err_debug:
#endif #endif
clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded); clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
return retval; return retval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment