801-usb-ehci-multiple-platform-driver-fix.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- a/drivers/usb/host/ehci-hcd.c
  2. +++ b/drivers/usb/host/ehci-hcd.c
  3. @@ -1383,12 +1383,12 @@ MODULE_LICENSE ("GPL");
  4. #ifdef CONFIG_USB_EHCI_HCD_PLATFORM
  5. #include "ehci-platform.c"
  6. -#define PLATFORM_DRIVER ehci_platform_driver
  7. +#define EHCI_PLATFORM_DRIVER ehci_platform_driver
  8. #endif
  9. #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
  10. !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \
  11. - !defined(XILINX_OF_PLATFORM_DRIVER)
  12. + !defined(XILINX_OF_PLATFORM_DRIVER) && !defined(EHCI_PLATFORM_DRIVER)
  13. #error "missing bus glue for ehci-hcd"
  14. #endif
  15. @@ -1448,8 +1448,19 @@ static int __init ehci_hcd_init(void)
  16. if (retval < 0)
  17. goto clean4;
  18. #endif
  19. +
  20. +#ifdef EHCI_PLATFORM_DRIVER
  21. + retval = platform_driver_register(&EHCI_PLATFORM_DRIVER);
  22. + if (retval < 0)
  23. + goto clean5;
  24. +#endif
  25. +
  26. return retval;
  27. +#ifdef EHCI_PLATFORM_DRIVER
  28. + platform_driver_unregister(&EHCI_PLATFORM_DRIVER);
  29. +clean5:
  30. +#endif
  31. #ifdef XILINX_OF_PLATFORM_DRIVER
  32. /* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */
  33. clean4:
  34. @@ -1482,6 +1493,9 @@ module_init(ehci_hcd_init);
  35. static void __exit ehci_hcd_cleanup(void)
  36. {
  37. +#ifdef EHCI_PLATFORM_DRIVER
  38. + platform_driver_unregister(&EHCI_PLATFORM_DRIVER);
  39. +#endif
  40. #ifdef XILINX_OF_PLATFORM_DRIVER
  41. platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER);
  42. #endif