patch-2.3.26 linux/drivers/usb/hub.c

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

diff -u --recursive --new-file v2.3.25/linux/drivers/usb/hub.c linux/drivers/usb/hub.c
@@ -105,7 +105,7 @@
 	int i;
 
 	/* Get the length first */
-	if (usb_get_hub_descriptor(dev, buffer, 4))
+	if (usb_get_hub_descriptor(dev, buffer, 4) < 0)
 		return -1;
 
 	header = (struct usb_descriptor_header *)buffer;
@@ -113,7 +113,7 @@
 	if (!bitmap)
 		return -1;
 
-	if (usb_get_hub_descriptor(dev, bitmap, header->bLength))
+	if (usb_get_hub_descriptor(dev, bitmap, header->bLength) < 0)
 		return -1;
 
 	descriptor = (struct usb_hub_descriptor *)bitmap;
@@ -166,7 +166,7 @@
 
 	kfree(bitmap);
 
-	if (usb_get_hub_status(dev, buffer))
+	if (usb_get_hub_status(dev, buffer) < 0)
 		return -1;
 
 	hubsts = (struct usb_hub_status *)buffer;
@@ -305,7 +305,7 @@
 	wait_ms(50);	/* FIXME: This is from the *BSD stack, thanks! :) */
 
 	/* Check status */
-	if (usb_get_port_status(hub, port + 1, &portsts)) {
+	if (usb_get_port_status(hub, port + 1, &portsts) < 0) {
 		printk(KERN_ERR "get_port_status failed\n");
 		return;
 	}
@@ -377,7 +377,7 @@
 			struct usb_port_status portsts;
 			unsigned short portstatus, portchange;
 
-			if (usb_get_port_status(dev, i + 1, &portsts)) {
+			if (usb_get_port_status(dev, i + 1, &portsts) < 0) {
 				printk(KERN_ERR "get_port_status failed\n");
 				continue;
 			}
@@ -474,7 +474,8 @@
 {
 	int pid;
 
-	usb_register(&hub_driver);
+	if (usb_register(&hub_driver) < 0)
+		return -1;
 
 	pid = kernel_thread(usb_hub_thread, NULL,
 		CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
@@ -487,7 +488,7 @@
 	/* Fall through if kernel_thread failed */
 	usb_deregister(&hub_driver);
 
-	return 1;
+	return -1;
 }
 
 void usb_hub_cleanup(void)

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