Skip to content

Commit

Permalink
Merge tag 'usb-ci-v4.2-rc5' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/peter.chen/usb into usb-linus

Peter writes:

It is a bug fix that using ehci_init_driver at wrong place, the
correct place should be at ci core driver's module_init, and
only be called one time.
  • Loading branch information
Greg Kroah-Hartman committed Jul 27, 2015
2 parents cbfe8fa + 2f01a33 commit a14aad0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
13 changes: 12 additions & 1 deletion drivers/usb/chipidea/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,18 @@ static struct platform_driver ci_hdrc_driver = {
},
};

module_platform_driver(ci_hdrc_driver);
static int __init ci_hdrc_platform_register(void)
{
ci_hdrc_host_driver_init();
return platform_driver_register(&ci_hdrc_driver);
}
module_init(ci_hdrc_platform_register);

static void __exit ci_hdrc_platform_unregister(void)
{
platform_driver_unregister(&ci_hdrc_driver);
}
module_exit(ci_hdrc_platform_unregister);

MODULE_ALIAS("platform:ci_hdrc");
MODULE_LICENSE("GPL v2");
Expand Down
7 changes: 5 additions & 2 deletions drivers/usb/chipidea/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,12 @@ int ci_hdrc_host_init(struct ci_hdrc *ci)
rdrv->name = "host";
ci->roles[CI_ROLE_HOST] = rdrv;

return 0;
}

void ci_hdrc_host_driver_init(void)
{
ehci_init_driver(&ci_ehci_hc_driver, &ehci_ci_overrides);
orig_bus_suspend = ci_ehci_hc_driver.bus_suspend;
ci_ehci_hc_driver.bus_suspend = ci_ehci_bus_suspend;

return 0;
}
6 changes: 6 additions & 0 deletions drivers/usb/chipidea/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

int ci_hdrc_host_init(struct ci_hdrc *ci);
void ci_hdrc_host_destroy(struct ci_hdrc *ci);
void ci_hdrc_host_driver_init(void);

#else

Expand All @@ -18,6 +19,11 @@ static inline void ci_hdrc_host_destroy(struct ci_hdrc *ci)

}

static void ci_hdrc_host_driver_init(void)
{

}

#endif

#endif /* __DRIVERS_USB_CHIPIDEA_HOST_H */

0 comments on commit a14aad0

Please sign in to comment.