On Wed, 28 Mar 2012, Lan Tianyu wrote: > Add struct usb_hub_port pointer port_data in the struct usb_hub and allocate > struct usb_hub_port perspectively for each ports to store private data. > > Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx> > --- > drivers/usb/core/hub.c | 29 +++++++++++++++-------------- > 1 files changed, 15 insertions(+), 14 deletions(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index aeefbab..1ee130d 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > void usb_hub_release_all_ports(struct usb_device *hdev, void *owner) > { > + struct usb_hub *hub = hdev_to_hub(hdev); > int n; > - void **powner; > > - n = find_port_owner(hdev, 1, &powner); > - if (n == 0) { > - for (; n < hdev->maxchild; (++n, ++powner)) { > - if (*powner == owner) > - *powner = NULL; > - } > - } > + for (n = 0; n < hdev->maxchild; n++) > + hub->port_data[n].port_owner = NULL; This is not quite right. It should be: for (n = 0; n < hdev->maxchild; n++) { if (hub->port_data[n].port_owner == owner) hub->port_data[n].port_owner = NULL; } Otherwise the patch is okay. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html