usb.c (50501936288d6a29d7ef78f25d00e33240fad45f) usb.c (015fbddefcfbf8b44c89b2e9b0b3dd77631f1e51)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * drivers/usb/core/usb.c
4 *
5 * (C) Copyright Linus Torvalds 1999
6 * (C) Copyright Johannes Erdfelt 1999-2001
7 * (C) Copyright Andreas Gal 1999
8 * (C) Copyright Gregory P. Smith 1999

--- 1087 unchanged lines hidden (view full) ---

1096 if (retval)
1097 goto bus_register_failed;
1098 retval = bus_register_notifier(&usb_bus_type, &usb_bus_nb);
1099 if (retval)
1100 goto bus_notifier_failed;
1101 retval = usb_major_init();
1102 if (retval)
1103 goto major_init_failed;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * drivers/usb/core/usb.c
4 *
5 * (C) Copyright Linus Torvalds 1999
6 * (C) Copyright Johannes Erdfelt 1999-2001
7 * (C) Copyright Andreas Gal 1999
8 * (C) Copyright Gregory P. Smith 1999

--- 1087 unchanged lines hidden (view full) ---

1096 if (retval)
1097 goto bus_register_failed;
1098 retval = bus_register_notifier(&usb_bus_type, &usb_bus_nb);
1099 if (retval)
1100 goto bus_notifier_failed;
1101 retval = usb_major_init();
1102 if (retval)
1103 goto major_init_failed;
1104 retval = class_register(&usbmisc_class);
1105 if (retval)
1106 goto class_register_failed;
1104 retval = usb_register(&usbfs_driver);
1105 if (retval)
1106 goto driver_register_failed;
1107 retval = usb_devio_init();
1108 if (retval)
1109 goto usb_devio_init_failed;
1110 retval = usb_hub_init();
1111 if (retval)
1112 goto hub_init_failed;
1113 retval = usb_register_device_driver(&usb_generic_driver, THIS_MODULE);
1114 if (!retval)
1115 goto out;
1116
1117 usb_hub_cleanup();
1118hub_init_failed:
1119 usb_devio_cleanup();
1120usb_devio_init_failed:
1121 usb_deregister(&usbfs_driver);
1122driver_register_failed:
1107 retval = usb_register(&usbfs_driver);
1108 if (retval)
1109 goto driver_register_failed;
1110 retval = usb_devio_init();
1111 if (retval)
1112 goto usb_devio_init_failed;
1113 retval = usb_hub_init();
1114 if (retval)
1115 goto hub_init_failed;
1116 retval = usb_register_device_driver(&usb_generic_driver, THIS_MODULE);
1117 if (!retval)
1118 goto out;
1119
1120 usb_hub_cleanup();
1121hub_init_failed:
1122 usb_devio_cleanup();
1123usb_devio_init_failed:
1124 usb_deregister(&usbfs_driver);
1125driver_register_failed:
1126 class_unregister(&usbmisc_class);
1127class_register_failed:
1123 usb_major_cleanup();
1124major_init_failed:
1125 bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);
1126bus_notifier_failed:
1127 bus_unregister(&usb_bus_type);
1128bus_register_failed:
1129 usb_acpi_unregister();
1130 usb_debugfs_cleanup();

--- 11 unchanged lines hidden (view full) ---

1142 return;
1143
1144 usb_release_quirk_list();
1145 usb_deregister_device_driver(&usb_generic_driver);
1146 usb_major_cleanup();
1147 usb_deregister(&usbfs_driver);
1148 usb_devio_cleanup();
1149 usb_hub_cleanup();
1128 usb_major_cleanup();
1129major_init_failed:
1130 bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);
1131bus_notifier_failed:
1132 bus_unregister(&usb_bus_type);
1133bus_register_failed:
1134 usb_acpi_unregister();
1135 usb_debugfs_cleanup();

--- 11 unchanged lines hidden (view full) ---

1147 return;
1148
1149 usb_release_quirk_list();
1150 usb_deregister_device_driver(&usb_generic_driver);
1151 usb_major_cleanup();
1152 usb_deregister(&usbfs_driver);
1153 usb_devio_cleanup();
1154 usb_hub_cleanup();
1155 class_unregister(&usbmisc_class);
1150 bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);
1151 bus_unregister(&usb_bus_type);
1152 usb_acpi_unregister();
1153 usb_debugfs_cleanup();
1154 idr_destroy(&usb_bus_idr);
1155}
1156
1157subsys_initcall(usb_init);
1158module_exit(usb_exit);
1159MODULE_LICENSE("GPL");
1156 bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);
1157 bus_unregister(&usb_bus_type);
1158 usb_acpi_unregister();
1159 usb_debugfs_cleanup();
1160 idr_destroy(&usb_bus_idr);
1161}
1162
1163subsys_initcall(usb_init);
1164module_exit(usb_exit);
1165MODULE_LICENSE("GPL");