patch-2.2.8 linux/drivers/usb/uhci.c

Next file: linux/drivers/usb/usb.c
Previous file: linux/drivers/usb/stopusb
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.7/linux/drivers/usb/uhci.c linux/drivers/usb/uhci.c
@@ -47,9 +47,6 @@
 
 #define compile_assert(x) do { switch (0) { case 1: case !(x): } } while (0)
 
-int usb_mouse_init(void);
-int hub_init(void);
-
 static struct wait_queue *uhci_configure = NULL;
 
 /*
@@ -515,6 +512,7 @@
 
 	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev) {
+		usb_destroy_configuration(usb_dev);
 		kfree(usb_dev);
 		return NULL;
 	}
@@ -573,6 +571,7 @@
 	}
 
 	kfree(dev);
+	usb_destroy_configuration(usb_dev);
 	kfree(usb_dev);
 
 	return 0;
@@ -995,6 +994,8 @@
 	kfree(uhci);
 }
 
+void cleanup_drivers(void);
+
 static int uhci_control_thread(void * __uhci)
 {
 	struct uhci *uhci = (struct uhci *)__uhci;
@@ -1052,6 +1053,8 @@
 			usb_disconnect(uhci->root_hub->usb->children + i);
 #endif
 
+	cleanup_drivers();
+
 	reset_hc(uhci);
 	release_region(uhci->io_addr, 32);
 
@@ -1199,4 +1202,12 @@
 		return 0;
 	}
 	return retval;
+}
+
+void cleanup_drivers(void)
+{
+	hub_cleanup();
+#ifdef CONFIG_USB_MOUSE
+	usb_mouse_cleanup();
+#endif
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)