On Tue, 17 Apr 2012, Hill, Steven wrote: > >> +const struct hc_driver ehci_sead3_hc_driver = { > >> + .description = hcd_name, > >> + .product_desc = "SEAD-3 EHCI", > >> + .hcd_priv_size = sizeof(struct ehci_hcd), > >> + > >> + /* > >> + * generic hardware linkage > >> + */ > >> + .irq = ehci_irq, > >> + .flags = HCD_MEMORY | HCD_USB2, > >> + > >> + /* > >> + * basic lifecycle operations > >> + * > >> + */ > >> + .reset = ehci_setup, > > > > You no longer care about the ehci->need_io_watchdog setting? > > > It was being set to zero, which is duplicated code. The 'usb_create_hcd' > function is doing a kzalloc for the data structure, making it redundant > to set it to zero in my code again. But ehci_init() sets it to 1. > >> + ehci = hcd_to_ehci(hcd); > >> + ehci->caps = hcd->regs + 0x100; > >> + ehci->regs = hcd->regs + 0x100 + > >> + HC_LENGTH(ehci, readl(&ehci->caps->hc_capbase)); > >> + /* cache this readonly data; minimize chip reads */ > >> + ehci->hcs_params = readl(&ehci->caps->hcs_params); > > > > The last four lines above are duplicates of code that is already > > present in ehci_setup. > > > Only the last line is duplicate code. The standard registers in our > controller are offset by 0x100 as you can see above. No. The registers are offset by 0x100 from hcd->regs, not from ehci->caps. ehci_setup() defines ehci->regs in relation to ehci->caps. Alan Stern -- 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