From cb44091fdfa1170f9c0a0a1d3396d6472fbf8911 Mon Sep 17 00:00:00 2001 From: Alexander Holler Date: Thu, 27 Jan 2011 22:50:07 +0100 Subject: [PATCH 1/2] USB: Fix device stati for removable and powerctrl (typo) I currently don't know if the error could have other consequences than a wrong output when turning debug on. Signed-off-by: Alexander Holler --- common/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb.c b/common/usb.c index 10e23de6a4..aa28de028f 100644 --- a/common/usb.c +++ b/common/usb.c @@ -1220,7 +1220,7 @@ int usb_hub_configure(struct usb_device *dev) hub->desc.DeviceRemovable[i] = descriptor->DeviceRemovable[i]; for (i = 0; i < ((hub->desc.bNbrPorts + 1 + 7)/8); i++) - hub->desc.DeviceRemovable[i] = descriptor->PortPowerCtrlMask[i]; + hub->desc.PortPowerCtrlMask[i] = descriptor->PortPowerCtrlMask[i]; dev->maxchild = descriptor->bNbrPorts; USB_HUB_PRINTF("%d ports detected\n", dev->maxchild); From ce297a8f7e6134b2dcbf4d180b1183a884f73c30 Mon Sep 17 00:00:00 2001 From: Alexander Holler Date: Fri, 28 Jan 2011 12:42:13 +0100 Subject: [PATCH 2/2] USB: Change the necessary defines to get debug output While debugging some USB stuff, I've first missed that there are actually two defines necessary to get usefull output. The one needed to get debug output for the communication with HUBs was burried somewhere deep inside the code. Change that so that a #define DEBUG is enough while still leaving the possibility to reduce unwanted debug output. Signed-off-by: Alexander Holler --- common/usb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/usb.c b/common/usb.c index aa28de028f..44a435af6e 100644 --- a/common/usb.c +++ b/common/usb.c @@ -55,7 +55,10 @@ #include #endif -#undef USB_DEBUG +#ifdef DEBUG +#define USB_DEBUG +#define USB_HUB_DEBUG +#endif #ifdef USB_DEBUG #define USB_PRINTF(fmt, args...) printf(fmt , ##args) @@ -960,8 +963,6 @@ void usb_scan_devices(void) * Probes device for being a hub and configurate it */ -#undef USB_HUB_DEBUG - #ifdef USB_HUB_DEBUG #define USB_HUB_PRINTF(fmt, args...) printf(fmt , ##args) #else