Exynos OHCI driver does not get registered if generic OHCI driver
is also selected as the macro PLATFORM_DRIVER gets re-defined to
'ohci_platform_driver' instead of 'exynos_ohci_driver'. Hence define
it separately.

Also, silences the following compilation warnings:
drivers/usb/host/ohci-hcd.c:1191:0: warning:
"PLATFORM_DRIVER" redefined [enabled by default]
drivers/usb/host/ohci-hcd.c:1110:0: note:
this is the location of the previous definition
drivers/usb/host/ohci-exynos.c:276:31: warning:
‘exynos_ohci_driver’ defined but not used [-Wunused-variable]

Signed-off-by: Sachin Kamat <sachin.ka...@linaro.org>
---
 drivers/usb/host/ohci-hcd.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 180a2b0..22b6ccd 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1107,7 +1107,7 @@ MODULE_LICENSE ("GPL");
 
 #ifdef CONFIG_USB_OHCI_EXYNOS
 #include "ohci-exynos.c"
-#define PLATFORM_DRIVER                exynos_ohci_driver
+#define EXYNOS_PLATFORM_DRIVER         exynos_ohci_driver
 #endif
 
 #ifdef CONFIG_USB_OHCI_HCD_OMAP1
@@ -1193,6 +1193,7 @@ MODULE_LICENSE ("GPL");
 
 #if    !defined(PCI_DRIVER) &&         \
        !defined(PLATFORM_DRIVER) &&    \
+       !defined(EXYNOS_PLATFORM_DRIVER) &&     \
        !defined(OMAP1_PLATFORM_DRIVER) &&      \
        !defined(OMAP3_PLATFORM_DRIVER) &&      \
        !defined(OF_PLATFORM_DRIVER) && \
@@ -1235,6 +1236,12 @@ static int __init ohci_hcd_mod_init(void)
                goto error_platform;
 #endif
 
+#ifdef EXYNOS_PLATFORM_DRIVER
+       retval = platform_driver_register(&EXYNOS_PLATFORM_DRIVER);
+       if (retval < 0)
+               goto error_exynos_platform;
+#endif
+
 #ifdef OMAP1_PLATFORM_DRIVER
        retval = platform_driver_register(&OMAP1_PLATFORM_DRIVER);
        if (retval < 0)
@@ -1304,6 +1311,10 @@ static int __init ohci_hcd_mod_init(void)
        platform_driver_unregister(&PLATFORM_DRIVER);
  error_platform:
 #endif
+#ifdef EXYNOS_PLATFORM_DRIVER
+       platform_driver_unregister(&EXYNOS_PLATFORM_DRIVER);
+ error_exynos_platform:
+#endif
 #ifdef OMAP1_PLATFORM_DRIVER
        platform_driver_unregister(&OMAP1_PLATFORM_DRIVER);
  error_omap1_platform:
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to