[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH] Remove wrong debug message



Alan, another one. Thank you.


Commit message:

When a device fails to initialize and it's physically removed, this
debug message shows bogus info. The device number will be shown in the
function usb_disconnect anyway.
Index: sys/usb/src.km/hub.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/hub.c,v
retrieving revision 1.5
diff -u -8 -r1.5 hub.c
--- sys/usb/src.km/hub.c	11 Feb 2014 22:39:34 -0000	1.5
+++ sys/usb/src.km/hub.c	18 Feb 2014 11:56:56 -0000
@@ -287,17 +287,16 @@
 
 	/* Clear the connection change status */
 	usb_clear_port_feature(dev, port + 1, USB_PORT_FEAT_C_CONNECTION);
 
 	/* Disconnect any existing devices under this port */
 	if (((!(portstatus & USB_PORT_STAT_CONNECTION)) &&
 	     (!(portstatus & USB_PORT_STAT_ENABLE))) || (dev->children[port])) {
 		DEBUG(("usb_disconnect"));
-		DEBUG(("devnum %ld", dev->children[port]->devnum));
 		usb_disconnect(&dev->children[port]);
 		dev->children[port] = NULL;
 		/* Return now if nothing is connected */
 		if (!(portstatus & USB_PORT_STAT_CONNECTION))
 			return;
 	}
 	mdelay(200);
 
Index: sys/usb/src.km/usb.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/usb.c,v
retrieving revision 1.7
diff -u -8 -r1.7 usb.c
--- sys/usb/src.km/usb.c	11 Feb 2014 22:39:35 -0000	1.7
+++ sys/usb/src.km/usb.c	18 Feb 2014 11:57:15 -0000
@@ -881,17 +881,16 @@
 /*
  * Free the newly created device node.
  * Called in error cases where configuring a newly attached
  * device fails for some reason.
  */
 void usb_free_device(long dev_index)
 {
 	DEBUG(("Freeing device node: %ld\n", dev_index));
-	dev_index--;
 	memset(&usb_dev[dev_index], 0, sizeof(struct usb_device));
 	usb_dev[dev_index].devnum = -1;
 }
 
 
 /*
  * By the time we get here, the device has gotten a new device ID
  * and is in the default state. We need to identify the thing and
@@ -952,16 +951,17 @@
 	/* Default to 64 byte max packet size */
 	dev->maxpacketsize = PACKET_SIZE_64;
 	dev->epmaxpacketin[0] = 64;
 	dev->epmaxpacketout[0] = 64;
 
 	err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
 	if (err < 0) {
 		DEBUG(("usb_new_device: usb_get_descriptor() failed"));
+		dev->devnum = addr;
 		return 1;
 	}
 
 	dev->descriptor.bMaxPacketSize0 = desc->bMaxPacketSize0;
 	/*
 	 * Fetch the device class, driver can use this info
 	 * to differentiate between HUB and DEVICE.
 	 */