From: Alan Stern Date: Tue, 20 Apr 2010 14:37:57 +0000 (-0400) Subject: USB: OHCI: don't look at the root hub to get the number of ports X-Git-Tag: v2.6.33.4~90 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2effcfb90e7e66c668bae37b47a9f804cba6781b;p=karo-tx-linux.git USB: OHCI: don't look at the root hub to get the number of ports commit fcf7d2141f4a363a4a8454c4a0f26bb69e766c5f upstream. This patch (as1371) fixes a small bug in ohci-hcd. The HCD already knows how many ports the controller has; there's no need to go looking at the root hub's usb_device structure to find out. Especially since the root hub's maxchild value is set correctly only while the root hub is bound to the hub driver. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 32bbce9718f0..65cac8cc8921 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c @@ -697,7 +697,7 @@ static int ohci_hub_control ( u16 wLength ) { struct ohci_hcd *ohci = hcd_to_ohci (hcd); - int ports = hcd_to_bus (hcd)->root_hub->maxchild; + int ports = ohci->num_ports; u32 temp; int retval = 0;