[RFC 05/17] usb/ehci: compile xilinx-of as separate compile unit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



while here get rid of:
|drivers/usb/host/ehci-xilinx-of.c:296: warning: initialization from incompatible pointer type

Signed-off-by: Sebastian Andrzej Siewior <sebastian@xxxxxxxxxxxxx>
---
 drivers/usb/host/Makefile         |    1 +
 drivers/usb/host/ehci-xilinx-of.c |   22 ++++++++++++++++------
 drivers/usb/host/ehci.c           |   19 ++++---------------
 drivers/usb/host/ehci.h           |    8 ++++++++
 4 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 18da948..82679f3 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -22,6 +22,7 @@ ehci-hcd-y	:= ehci.o
 ehci-hcd-$(CONFIG_PCI)	+= ehci-pci.o
 ehci-hcd-$(CONFIG_PPC_PS3)	+= ehci-ps3.o
 ehci-hcd-$(CONFIG_USB_EHCI_HCD_PPC_OF)	+= ehci-ppc-of.o
+ehci-hcd-$(XILINX_OF_PLATFORM_DRIVER)	+= ehci-xilinx-of.o
 obj-$(CONFIG_USB_EHCI_HCD)	+= ehci-hcd.o
 obj-$(CONFIG_USB_OXU210HP_HCD)	+= oxu210hp-hcd.o
 obj-$(CONFIG_USB_ISP116X_HCD)	+= isp116x-hcd.o
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c
index 32793ce..8deebb8 100644
--- a/drivers/usb/host/ehci-xilinx-of.c
+++ b/drivers/usb/host/ehci-xilinx-of.c
@@ -25,11 +25,14 @@
  *
  */
 
+#include <linux/usb/hcd.h>
+#include <linux/dma-mapping.h>
 #include <linux/signal.h>
 
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/of_address.h>
+#include "ehci.h"
 
 /**
  * ehci_xilinx_of_setup - Initialize the device for ehci_reset()
@@ -94,7 +97,7 @@ static int ehci_xilinx_port_handed_over(struct usb_hcd *hcd, int portnum)
 
 
 static const struct hc_driver ehci_xilinx_of_hc_driver = {
-	.description		= hcd_name,
+	.description		= "ehci_hcd",
 	.product_desc		= "OF EHCI",
 	.hcd_priv_size		= sizeof(struct ehci_hcd),
 
@@ -176,7 +179,7 @@ static int __devinit ehci_hcd_xilinx_of_probe(struct platform_device *op)
 	hcd->rsrc_start = res.start;
 	hcd->rsrc_len = resource_size(&res);
 
-	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, "ehci_hcd")) {
 		printk(KERN_ERR "%s: request_mem_region failed\n", __FILE__);
 		rv = -EBUSY;
 		goto err_rmr;
@@ -270,17 +273,14 @@ static int ehci_hcd_xilinx_of_remove(struct platform_device *op)
  *
  * Properly shutdown the hcd, call driver's shutdown routine.
  */
-static int ehci_hcd_xilinx_of_shutdown(struct platform_device *op)
+static void ehci_hcd_xilinx_of_shutdown(struct platform_device *op)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
 
 	if (hcd->driver->shutdown)
 		hcd->driver->shutdown(hcd);
-
-	return 0;
 }
 
-
 static const struct of_device_id ehci_hcd_xilinx_of_match[] = {
 		{.compatible = "xlnx,xps-usb-host-1.00.a",},
 	{},
@@ -297,3 +297,13 @@ static struct platform_driver ehci_hcd_xilinx_of_driver = {
 		.of_match_table = ehci_hcd_xilinx_of_match,
 	},
 };
+
+__init int ehci_xilinx_of_register(void)
+{
+	return platform_driver_register(&ehci_hcd_xilinx_of_driver);
+}
+
+void ehci_xilinx_of_unregister(void)
+{
+	platform_driver_unregister(&ehci_hcd_xilinx_of_driver);
+}
diff --git a/drivers/usb/host/ehci.c b/drivers/usb/host/ehci.c
index dbe6afd..42c02a5 100644
--- a/drivers/usb/host/ehci.c
+++ b/drivers/usb/host/ehci.c
@@ -1191,11 +1191,6 @@ MODULE_LICENSE ("GPL");
 #define        PLATFORM_DRIVER         ehci_hcd_omap_driver
 #endif
 
-#ifdef CONFIG_XPS_USB_HCD_XILINX
-#include "ehci-xilinx-of.c"
-#define XILINX_OF_PLATFORM_DRIVER	ehci_hcd_xilinx_of_driver
-#endif
-
 #ifdef CONFIG_PLAT_ORION
 #include "ehci-orion.c"
 #define	PLATFORM_DRIVER		ehci_orion_driver
@@ -1278,7 +1273,7 @@ MODULE_LICENSE ("GPL");
 
 #if !defined(CONFIG_PCI) && !defined(PLATFORM_DRIVER) && \
     !defined(CONFIG_PPC_PS3) && !defined(CONFIG_USB_EHCI_HCD_PPC_OF) && \
-    !defined(XILINX_OF_PLATFORM_DRIVER)
+    !defined(CONFIG_XPS_USB_HCD_XILINX)
 #error "missing bus glue for ehci-hcd"
 #endif
 
@@ -1327,17 +1322,13 @@ static int __init ehci_hcd_init(void)
 	if (retval < 0)
 		goto clean3;
 
-#ifdef XILINX_OF_PLATFORM_DRIVER
-	retval = platform_driver_register(&XILINX_OF_PLATFORM_DRIVER);
+	retval = ehci_xilinx_of_register();
 	if (retval < 0)
 		goto clean4;
-#endif
 	return retval;
 
-#ifdef XILINX_OF_PLATFORM_DRIVER
-	/* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */
+	ehci_xilinx_of_unregister();
 clean4:
-#endif
 	ehci_ppc_of_unregister();
 clean3:
 	ehci_ps3_unregister();
@@ -1360,9 +1351,7 @@ module_init(ehci_hcd_init);
 
 static void __exit ehci_hcd_cleanup(void)
 {
-#ifdef XILINX_OF_PLATFORM_DRIVER
-	platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER);
-#endif
+	ehci_xilinx_of_unregister();
 	ehci_ppc_of_unregister();
 #ifdef PLATFORM_DRIVER
 	platform_driver_unregister(&PLATFORM_DRIVER);
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 0f57718..35fc8ce 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -813,6 +813,14 @@ static inline int ehci_ppc_of_register(void) { return 0; }
 static inline void ehci_ppc_of_unregister(void) {};
 #endif
 
+#ifdef CONFIG_USB_EHCI_HCD_PPC_OF
+int ehci_xilinx_of_register(void);
+void ehci_xilinx_of_unregister(void);
+#else
+static inline int ehci_xilinx_of_register(void) { return 0; }
+static inline void ehci_xilinx_of_unregister(void) {};
+#endif
+
 /*-------------------------------------------------------------------------*/
 
 #ifndef DEBUG
-- 
1.7.5.4

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux