cns21xx: fix build errors on 3.6

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 34756
This commit is contained in:
Gabor Juhos 2012-12-18 14:51:55 +00:00
parent 5a680f1cbf
commit 9e1a54296a
4 changed files with 101 additions and 8 deletions

View file

@ -1,6 +1,6 @@
--- a/arch/arm/Kconfig --- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig +++ b/arch/arm/Kconfig
@@ -1133,10 +1133,15 @@ source "arch/arm/mach-vt8500/Kconfig" @@ -1134,10 +1134,15 @@ source "arch/arm/mach-vt8500/Kconfig"
source "arch/arm/mach-w90x900/Kconfig" source "arch/arm/mach-w90x900/Kconfig"

View file

@ -28,7 +28,7 @@
config ARCH_CLPS711X config ARCH_CLPS711X
bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
select CPU_ARM720T select CPU_ARM720T
@@ -1041,6 +1055,8 @@ source "arch/arm/mach-davinci/Kconfig" @@ -1042,6 +1056,8 @@ source "arch/arm/mach-davinci/Kconfig"
source "arch/arm/mach-dove/Kconfig" source "arch/arm/mach-dove/Kconfig"

View file

@ -30,9 +30,58 @@
#ifdef CONFIG_USB_CNS3XXX_OHCI #ifdef CONFIG_USB_CNS3XXX_OHCI
#include "ohci-cns3xxx.c" #include "ohci-cns3xxx.c"
#define PLATFORM_DRIVER ohci_hcd_cns3xxx_driver #define PLATFORM_DRIVER ohci_hcd_cns3xxx_driver
@@ -1117,7 +1124,7 @@ MODULE_LICENSE ("GPL");
#ifdef CONFIG_USB_OHCI_HCD_PLATFORM
#include "ohci-platform.c"
-#define PLATFORM_DRIVER ohci_platform_driver
+#define OHCI_PLATFORM_DRIVER ohci_platform_driver
#endif
#if !defined(PCI_DRIVER) && \
@@ -1128,7 +1135,8 @@ MODULE_LICENSE ("GPL");
!defined(SA1111_DRIVER) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(SM501_OHCI_DRIVER) && \
- !defined(TMIO_OHCI_DRIVER)
+ !defined(TMIO_OHCI_DRIVER) && \
+ !defined(OHCI_PLATFORM_DRIVER)
#error "missing bus glue for ohci-hcd"
#endif
@@ -1206,9 +1214,19 @@ static int __init ohci_hcd_mod_init(void
goto error_tmio;
#endif
+#ifdef OHCI_PLATFORM_DRIVER
+ retval = platform_driver_register(&OHCI_PLATFORM_DRIVER);
+ if (retval < 0)
+ goto error_ohci;
+#endif
+
return retval;
/* Error path */
+#ifdef OHCI_PLATFORM_DRIVER
+ platform_driver_unregister(&OHCI_PLATFORM_DRIVER);
+ error_ohci:
+#endif
#ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(&TMIO_OHCI_DRIVER);
error_tmio:
@@ -1258,6 +1276,9 @@ module_init(ohci_hcd_mod_init);
static void __exit ohci_hcd_mod_exit(void)
{
+#ifdef OHCI_PLATFORM_DRIVER
+ platform_driver_unregister(&OHCI_PLATFORM_DRIVER);
+#endif
#ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(&TMIO_OHCI_DRIVER);
#endif
--- /dev/null --- /dev/null
+++ b/drivers/usb/host/ohci-cns21xx.c +++ b/drivers/usb/host/ohci-cns21xx.c
@@ -0,0 +1,175 @@ @@ -0,0 +1,176 @@
+/* +/*
+ * Copyright (c) 2008 Cavium Networks + * Copyright (c) 2008 Cavium Networks
+ * Copyright (c) 2010-2012 Gabor Juhos <juhosg@openwrt.org> + * Copyright (c) 2010-2012 Gabor Juhos <juhosg@openwrt.org>
@ -59,7 +108,8 @@
+ +
+ ret = ohci_run(ohci); + ret = ohci_run(ohci);
+ if (ret) { + if (ret) {
+ err("can't start %s", ohci_to_hcd(ohci)->self.bus_name); + ohci_err(ohci, "can't start %s",
+ ohci_to_hcd(ohci)->self.bus_name);
+ goto err; + goto err;
+ } + }
+ +

View file

@ -189,8 +189,8 @@
+MODULE_ALIAS("platform:" DRIVER_NAME); +MODULE_ALIAS("platform:" DRIVER_NAME);
--- a/drivers/usb/host/ehci-hcd.c --- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c
@@ -1339,6 +1339,11 @@ MODULE_LICENSE ("GPL"); @@ -1334,14 +1334,19 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_platform_driver #define PLATFORM_DRIVER ehci_hcd_sead3_driver
#endif #endif
+#ifdef CONFIG_ARCH_CNS21XX +#ifdef CONFIG_ARCH_CNS21XX
@ -198,9 +198,52 @@
+#define PLATFORM_DRIVER ehci_cns21xx_driver +#define PLATFORM_DRIVER ehci_cns21xx_driver
+#endif +#endif
+ +
#ifdef CONFIG_USB_EHCI_HCD_PLATFORM
#include "ehci-platform.c"
-#define PLATFORM_DRIVER ehci_platform_driver
+#define EHCI_PLATFORM_DRIVER ehci_platform_driver
#endif
#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \ !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER) - !defined(XILINX_OF_PLATFORM_DRIVER)
+ !defined(XILINX_OF_PLATFORM_DRIVER) && !defined(EHCI_PLATFORM_DRIVER)
#error "missing bus glue for ehci-hcd"
#endif
@@ -1401,10 +1406,21 @@ static int __init ehci_hcd_init(void)
if (retval < 0)
goto clean4;
#endif
+
+#ifdef EHCI_PLATFORM_DRIVER
+ retval = platform_driver_register(&EHCI_PLATFORM_DRIVER);
+ if (retval < 0)
+ goto clean5;
+#endif
+
return retval;
+#ifdef EHCI_PLATFORM_DRIVER
+ platform_driver_unregister(&EHCI_PLATFORM_DRIVER);
+clean5:
+#endif
#ifdef XILINX_OF_PLATFORM_DRIVER
- /* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */
+ platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER);
clean4:
#endif
#ifdef OF_PLATFORM_DRIVER
@@ -1435,6 +1451,9 @@ module_init(ehci_hcd_init);
static void __exit ehci_hcd_cleanup(void)
{
+#ifdef EHCI_PLATFORM_DRIVER
+ platform_driver_unregister(&EHCI_PLATFORM_DRIVER);
+#endif
#ifdef XILINX_OF_PLATFORM_DRIVER
platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER);
#endif
--- a/arch/arm/Kconfig --- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig +++ b/arch/arm/Kconfig
@@ -394,6 +394,7 @@ config ARCH_CNS21XX @@ -394,6 +394,7 @@ config ARCH_CNS21XX