RE: [PATCH v3 10/10] usb: host: mips: sead3: USB Host controller support for SEAD-3 platform.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> +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.

>> +     hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
>> +     if (!hcd->regs) {
>> +             pr_debug("ioremap failed");
>> +             ret = -ENOMEM;
>> +             goto err2;
>> +     }
>> +
>> +     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.

-Steve--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux