r3108 - trunk/src/host/usbreset

werner at sita.openmoko.org werner at sita.openmoko.org
Mon Oct 8 05:49:37 CEST 2007


Author: werner
Date: 2007-10-08 05:49:33 +0200 (Mon, 08 Oct 2007)
New Revision: 3108

Modified:
   trunk/src/host/usbreset/usbreset.c
Log:
usbreset.c (main): instead of skipping hubs, allow resetting them, and ignore
  the EISDIR error return if it's a root hub



Modified: trunk/src/host/usbreset/usbreset.c
===================================================================
--- trunk/src/host/usbreset/usbreset.c	2007-10-08 03:17:01 UTC (rev 3107)
+++ trunk/src/host/usbreset/usbreset.c	2007-10-08 03:49:33 UTC (rev 3108)
@@ -22,6 +22,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <errno.h>
 #include <usb.h>
 
 
@@ -58,8 +59,6 @@
 		for (dev = usb_bus->devices; dev; dev = dev->next) {
 			struct usb_dev_handle *handle;
 
-			if (dev->descriptor.bDeviceClass == USB_CLASS_HUB)
-				continue;
 			if (!all &&
 			    (atoi(usb_bus->dirname) != bus_num ||
 			    dev->devnum != dev_num))
@@ -71,7 +70,9 @@
 				    usb_strerror());
 				continue;
 			}
-			if (usb_reset(handle) < 0) {
+			if (usb_reset(handle) < 0 && 
+			    (dev->descriptor.bDeviceClass != USB_CLASS_HUB ||
+			    errno != EISDIR)) {
 				fprintf(stderr, "usb_reset: %s\n",
 				    usb_strerror());
 				continue;





More information about the commitlog mailing list