Re: [PATCH 2/3] USB/ACPI: Add usb port's acpi power control in the xhci PORT_POWER feature request process.
|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Wed, Jun 13, 2012 at 05:10:43PM -0400, Alan Stern wrote: > On Wed, 13 Jun 2012, Greg KH wrote: > > > > --- a/drivers/usb/host/xhci-hub.c > > > +++ b/drivers/usb/host/xhci-hub.c > > > @@ -728,6 +728,11 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, > > > > > > temp = xhci_readl(xhci, port_array[wIndex]); > > > xhci_dbg(xhci, "set port power, actual port %d status = 0x%x\n", wIndex, temp); > > > + > > > + if (usb_acpi_power_manageable(hcd->self.root_hub, > > > + wIndex + 1)) > > > > Why +1? If you have to do this everywhere, then do it only in the > > function, so you can be 0 based properly. > > This is an awkward matter. The USB spec numbers hub ports starting > from 1, and so do several of the functions in usbcore, in order to > match the spec. But of course, all our internal arrays are indexed > starting from 0. > > The cleanest solution here might be to keep wIndex as an origin-0 value > and create an origin-1 temporary variable (like hub.c does with > "port1"). Oh, is that why it's named port1? I could never understand why. :) Sarah Sharp -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Media] [Video for Linux] [Linux Input] [Linux Audio Users] [Photo] [Yosemite News] [Yosemite Photos] [Free Online Dating] [Linux Kernel] [Linux SCSI] [Old Linux USB Devel Archive] [More Archives]