USB: OHCI: make ohci-da8xx a separate driver
Subsystems (2)
PATCH 1/1 USB: OHCI: make ohci-da8xx a separate driver
From: Manjunath Goudar <[email protected]>
Separate the Davinci OHCI host controller driver from ohci-hcd host code so that it can be built as a separate driver module. This work is part of enabling multi-platform kernels on ARM
---
This was a previews patch submited by Manjunath [1] that was never taken in because of an undefined symbol when loading as a module. That symbol is not present anymore so we can safly build the driver as a module.
I rebased, fixing the minor remaining comments.
Axel.
http://patches.linaro.org/patch/18234/
drivers/usb/host/Kconfig | 4 +- drivers/usb/host/Makefile | 1 + drivers/usb/host/ohci-da8xx.c | 181 +++++++++++++++++------------------------- drivers/usb/host/ohci-hcd.c | 18 ----- 4 files changed, 74 insertions(+), 130 deletions(-)
drivers/usb/host/Kconfig +2 -2
@@ -479,9 +479,9 @@ config USB_OHCI_HCD_OMAP3 OMAP3 and later chips. config USB_OHCI_HCD_DAVINCI - bool "OHCI support for TI DaVinci DA8xx" + tristate "OHCI support for TI DaVinci DA8xx" depends on ARCH_DAVINCI_DA8XX - depends on USB_OHCI_HCD=y + depends on USB_OHCI_HCD select PHY_DA8XX_USB default y help
drivers/usb/host/Makefile +1 -0
@@ -61,6 +61,7 @@ obj-$(CONFIG_USB_OHCI_HCD_AT91) += ohci-at91.o obj-$(CONFIG_USB_OHCI_HCD_S3C2410) += ohci-s3c2410.o obj-$(CONFIG_USB_OHCI_HCD_LPC32XX) += ohci-nxp.o obj-$(CONFIG_USB_OHCI_HCD_PXA27X) += ohci-pxa27x.o +obj-$(CONFIG_USB_OHCI_HCD_DAVINCI) += ohci-da8xx.o obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
drivers/usb/host/ohci-da8xx.c +71 -110
272 lines not on this page · raw message
drivers/usb/host/ohci-hcd.c +0 -18
@@ -1219,11 +1219,6 @@ void ohci_init_driver(struct hc_driver *drv,#define SA1111_DRIVER ohci_hcd_sa1111_driver#endif -#ifdef CONFIG_USB_OHCI_HCD_DAVINCI -#include "ohci-da8xx.c" -#define DAVINCI_PLATFORM_DRIVER ohci_hcd_da8xx_driver -#endif -#ifdef CONFIG_USB_OHCI_HCD_PPC_OF #include "ohci-ppc-of.c" #define OF_PLATFORM_DRIVER ohci_hcd_ppc_of_driver
@@ -1303,19 +1298,9 @@ static int __init ohci_hcd_mod_init(void) goto error_tmio;#endif -#ifdef DAVINCI_PLATFORM_DRIVER - retval =platform_driver_register (&DAVINCI_PLATFORM_DRIVER ); -if (retval <0 ) - goto error_davinci; -#endif -return retval;/* Error path */ -#ifdef DAVINCI_PLATFORM_DRIVER -platform_driver_unregister (&DAVINCI_PLATFORM_DRIVER ); - error_davinci: -#endif #ifdef TMIO_OHCI_DRIVER platform_driver_unregister (&TMIO_OHCI_DRIVER ); error_tmio:
@@ -1351,9 +1336,6 @@ static int __init ohci_hcd_mod_init(void) static void __exit ohci_hcd_mod_exit(void) { -#ifdef DAVINCI_PLATFORM_DRIVER -platform_driver_unregister (&DAVINCI_PLATFORM_DRIVER ); -#endif #ifdef TMIO_OHCI_DRIVER platform_driver_unregister (&TMIO_OHCI_DRIVER );#endif
Signature · 1 line
1.9.1
drivers/usb/host/ohci-da8xx.c static int ohci_da8xx_resume(struct platform_device *dev) · line 407
Quoted 4 lines · On 10/26/2016 04:08 PM, [email protected] wrote:
drivers/usb/host/ohci-da8xx.c +3
-0+module_exit (ohci_da8xx_exit); +MODULE_DESCRIPTION (DRIVER_DESC ); +MODULE_LICENSE ("GPL" );MODULE_ALIAS ("platform:ohci" );
The "ohci" in MODULE_ALIAS() should also be replaced with hcd_name.
Quoted 9 lines · David Lechner
drivers/usb/host/ohci-da8xx.c static int ohci_da8xx_resume(struct platform_device *dev) · line 407
Quoted 4 lines · On 10/26/2016 04:08 PM, [email protected] wrote:
drivers/usb/host/ohci-da8xx.c +3
-0+module_exit (ohci_da8xx_exit); +MODULE_DESCRIPTION (DRIVER_DESC ); +MODULE_LICENSE ("GPL" );MODULE_ALIAS ("platform:ohci" );The "ohci" in
MODULE_ALIAS()should also be replaced withhcd_name.
i dont see any other module int the whole kernel that is using a const char here, ill just change back to #define the name and use that instead.
Quoted 2 lines
Quoted 10 lines · On 10/26/2016 04:08 PM, [email protected] wrote:
From: Manjunath Goudar <[email protected]>
Separate the Davinci OHCI host controller driver from ohci-hcd host code so that it can be built as a separate driver module. This work is part of enabling multi-platform kernels on ARM
Signed-off-by Manjunath Goudar <[email protected]>[Axel: adapted and rebased, fixed minor comments]Signed-off-by Axel Haslam <[email protected]>---
This is working for me as a module on LEGO MINDSTORMS EV3.