On Mon, 20 Jul 2015, Peter Chen wrote:
> > I don't think a new use case is needed. All you have to do is add
> > something like this to host.c:
> >
> > static void ci_hdrc_host_driver_init(void)
> > {
> > ehci_init_driver(&ci_ehci_hc_driver, &ehci_ci_overrides);
By the way, right here I forgot to include:
orig_bus_suspend = ci_ehci_hc_driver.bus_suspend;
ci_ehci_hc_driver.bus_suspend = ci_ehci_bus_suspend;
> > }
> > module_init(ci_hdrc_host_driver_init);
> >
> > Can you think of any reason this won't work?
> >
>
> No, it will not work. The core driver's probe will run which will
> call host_start to call ehci APIs before ci_hdrc_host_driver_init
> is called.
Ah, I see the difficulty. core.c does
pci_register_driver(&ehci_pci_driver). That will have to be different.
Let's change that line to this:
static int __init ci_hdrc_driver_init(void)
{
ci_hdrc_host_driver_init();
return platform_register_driver(&ci_hdrc_driver);
}
module_init(ci_hdrc_driver_init);
static void __exit ci_hdrc_driver_cleanup(void)
{
platform_unregister_driver(&ci_hdrc_driver);
}
module_exit(ci_hdrc_driver_cleanup);
Then in host.c, make ci_hdrc_host_driver_init non-static.
This should work, because the core's probe routine can't be called
before it is registered as a platform driver, and that doesn't happen
until after ehci_init_driver is called.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html