800-usb-ohci-multiple-platform-driver-fix.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- a/drivers/usb/host/ohci-hcd.c
  2. +++ b/drivers/usb/host/ohci-hcd.c
  3. @@ -1188,7 +1188,7 @@ MODULE_LICENSE ("GPL");
  4. #ifdef CONFIG_USB_OHCI_HCD_PLATFORM
  5. #include "ohci-platform.c"
  6. -#define PLATFORM_DRIVER ohci_platform_driver
  7. +#define OHCI_PLATFORM_DRIVER ohci_platform_driver
  8. #endif
  9. #if !defined(PCI_DRIVER) && \
  10. @@ -1199,7 +1199,8 @@ MODULE_LICENSE ("GPL");
  11. !defined(SA1111_DRIVER) && \
  12. !defined(PS3_SYSTEM_BUS_DRIVER) && \
  13. !defined(SM501_OHCI_DRIVER) && \
  14. - !defined(TMIO_OHCI_DRIVER)
  15. + !defined(TMIO_OHCI_DRIVER) && \
  16. + !defined(OHCI_PLATFORM_DRIVER)
  17. #error "missing bus glue for ohci-hcd"
  18. #endif
  19. @@ -1277,9 +1278,19 @@ static int __init ohci_hcd_mod_init(void
  20. goto error_tmio;
  21. #endif
  22. +#ifdef OHCI_PLATFORM_DRIVER
  23. + retval = platform_driver_register(&OHCI_PLATFORM_DRIVER);
  24. + if (retval < 0)
  25. + goto error_ohci;
  26. +#endif
  27. +
  28. return retval;
  29. /* Error path */
  30. +#ifdef OHCI_PLATFORM_DRIVER
  31. + platform_driver_unregister(&OHCI_PLATFORM_DRIVER);
  32. + error_ohci:
  33. +#endif
  34. #ifdef TMIO_OHCI_DRIVER
  35. platform_driver_unregister(&TMIO_OHCI_DRIVER);
  36. error_tmio:
  37. @@ -1329,6 +1340,9 @@ module_init(ohci_hcd_mod_init);
  38. static void __exit ohci_hcd_mod_exit(void)
  39. {
  40. +#ifdef OHCI_PLATFORM_DRIVER
  41. + platform_driver_unregister(&OHCI_PLATFORM_DRIVER);
  42. +#endif
  43. #ifdef TMIO_OHCI_DRIVER
  44. platform_driver_unregister(&TMIO_OHCI_DRIVER);
  45. #endif