aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-dbg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-dbg.c')
-rw-r--r--drivers/usb/host/ehci-dbg.c58
1 files changed, 21 insertions, 37 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 4498efb49b95..76b7fd2d838a 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -1049,49 +1049,33 @@ static inline void create_debug_files (struct ehci_hcd *ehci)
1049 1049
1050 ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root); 1050 ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root);
1051 if (!ehci->debug_dir) 1051 if (!ehci->debug_dir)
1052 goto dir_error; 1052 return;
1053 1053
1054 ehci->debug_async = debugfs_create_file("async", S_IRUGO, 1054 if (!debugfs_create_file("async", S_IRUGO, ehci->debug_dir, bus,
1055 ehci->debug_dir, bus, 1055 &debug_async_fops))
1056 &debug_async_fops); 1056 goto file_error;
1057 if (!ehci->debug_async) 1057
1058 goto async_error; 1058 if (!debugfs_create_file("periodic", S_IRUGO, ehci->debug_dir, bus,
1059 1059 &debug_periodic_fops))
1060 ehci->debug_periodic = debugfs_create_file("periodic", S_IRUGO, 1060 goto file_error;
1061 ehci->debug_dir, bus, 1061
1062 &debug_periodic_fops); 1062 if (!debugfs_create_file("registers", S_IRUGO, ehci->debug_dir, bus,
1063 if (!ehci->debug_periodic) 1063 &debug_registers_fops))
1064 goto periodic_error; 1064 goto file_error;
1065 1065
1066 ehci->debug_registers = debugfs_create_file("registers", S_IRUGO, 1066 if (!debugfs_create_file("lpm", S_IRUGO|S_IWUGO, ehci->debug_dir, bus,
1067 ehci->debug_dir, bus, 1067 &debug_lpm_fops))
1068 &debug_registers_fops); 1068 goto file_error;
1069 1069
1070 ehci->debug_registers = debugfs_create_file("lpm", S_IRUGO|S_IWUGO,
1071 ehci->debug_dir, bus,
1072 &debug_lpm_fops);
1073 if (!ehci->debug_registers)
1074 goto registers_error;
1075 return; 1070 return;
1076 1071
1077registers_error: 1072file_error:
1078 debugfs_remove(ehci->debug_periodic); 1073 debugfs_remove_recursive(ehci->debug_dir);
1079periodic_error:
1080 debugfs_remove(ehci->debug_async);
1081async_error:
1082 debugfs_remove(ehci->debug_dir);
1083dir_error:
1084 ehci->debug_periodic = NULL;
1085 ehci->debug_async = NULL;
1086 ehci->debug_dir = NULL;
1087} 1074}
1088 1075
1089static inline void remove_debug_files (struct ehci_hcd *ehci) 1076static inline void remove_debug_files (struct ehci_hcd *ehci)
1090{ 1077{
1091 debugfs_remove(ehci->debug_registers); 1078 debugfs_remove_recursive(ehci->debug_dir);
1092 debugfs_remove(ehci->debug_periodic);
1093 debugfs_remove(ehci->debug_async);
1094 debugfs_remove(ehci->debug_dir);
1095} 1079}
1096 1080
1097#endif /* STUB_DEBUG_FILES */ 1081#endif /* STUB_DEBUG_FILES */