Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: fotg210-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: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Johan Hovold <johan@kernel.org>
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@intel.com>
Cc: Vasyl Gomonovych <gomonovych@gmail.com>
Cc: Mariusz Skamra <mariuszx.skamra@intel.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+9 -25
+9 -25
drivers/usb/host/fotg210-hcd.c
··· 844 844 static inline void create_debug_files(struct fotg210_hcd *fotg210) 845 845 { 846 846 struct usb_bus *bus = &fotg210_to_hcd(fotg210)->self; 847 + struct dentry *root; 847 848 848 - fotg210->debug_dir = debugfs_create_dir(bus->bus_name, 849 - fotg210_debug_root); 850 - if (!fotg210->debug_dir) 851 - return; 849 + root = debugfs_create_dir(bus->bus_name, fotg210_debug_root); 850 + fotg210->debug_dir = root; 852 851 853 - if (!debugfs_create_file("async", S_IRUGO, fotg210->debug_dir, bus, 854 - &debug_async_fops)) 855 - goto file_error; 856 - 857 - if (!debugfs_create_file("periodic", S_IRUGO, fotg210->debug_dir, bus, 858 - &debug_periodic_fops)) 859 - goto file_error; 860 - 861 - if (!debugfs_create_file("registers", S_IRUGO, fotg210->debug_dir, bus, 862 - &debug_registers_fops)) 863 - goto file_error; 864 - 865 - return; 866 - 867 - file_error: 868 - debugfs_remove_recursive(fotg210->debug_dir); 852 + debugfs_create_file("async", S_IRUGO, root, bus, &debug_async_fops); 853 + debugfs_create_file("periodic", S_IRUGO, root, bus, 854 + &debug_periodic_fops); 855 + debugfs_create_file("registers", S_IRUGO, root, bus, 856 + &debug_registers_fops); 869 857 } 870 858 871 859 static inline void remove_debug_files(struct fotg210_hcd *fotg210) ··· 5674 5686 sizeof(struct fotg210_itd)); 5675 5687 5676 5688 fotg210_debug_root = debugfs_create_dir("fotg210", usb_debug_root); 5677 - if (!fotg210_debug_root) { 5678 - retval = -ENOENT; 5679 - goto err_debug; 5680 - } 5681 5689 5682 5690 retval = platform_driver_register(&fotg210_hcd_driver); 5683 5691 if (retval < 0) ··· 5683 5699 clean: 5684 5700 debugfs_remove(fotg210_debug_root); 5685 5701 fotg210_debug_root = NULL; 5686 - err_debug: 5702 + 5687 5703 clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded); 5688 5704 return retval; 5689 5705 }