USB EHCI multiplatform conversion
Subsystems (4)
PATCH v4 1/6 USB: EHCI: make ehci-orion a separate driver
In reply to Arnd BergmannFrom: Manjunath Goudar <[email protected]>
Separate the Orion host controller driver from ehci-hcd host code into its own driver module because of following reason.
With the multiplatform changes in arm-soc tree, it becomes possible to enable the mvebu platform (which uses ehci-orion) at the same time as other platforms that require a conflicting EHCI bus glue. At the moment, this results in a warning like
drivers/usb/host/ehci-hcd.c:1297:0: warning: "PLATFORM_DRIVER" redefined [enabled by default] drivers/usb/host/ehci-hcd.c:1277:0: note: this is the location of the previous definition drivers/usb/host/ehci-orion.c:334:31: warning: 'ehci_orion_driver' defined but not used [-Wunused-variable]
and an ehci driver that only works on one of them.
With the infrastructure added by Alan Stern in patch 3e0232039 "USB: EHCI: prepare to make ehci-hcd a library module", we can avoid this problem by turning a bus glue into a separate module, as we do here for the orion bus glue.
An earlier version of this patch was included in 3.9 but caused a regression there, which has subsequently been fixed.
While we are here, use the opportunity to disabiguate the two Marvell EHCI controller implementations in Kconfig.
In V3:
1.More detail provided in commit message regarding this patch. 2.Replaced hcd_name string "ehci-orion" into "orion-ehci". 3.MODULE_LICENSE is GPL v2.
4.In ehci_init_driver calling second argument passed as NULL instead of
ehci_orion_overrides because ehci_orion_overrides is removed.
In V2:
Tegra patch related changes removed from this patch.
--- drivers/usb/host/Kconfig | 17 ++++++++- drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-hcd.c | 6 +--- drivers/usb/host/ehci-orion.c | 82 ++++++++++++++++++------------------------- 4 files changed, 53 insertions(+), 53 deletions(-)
drivers/usb/host/Kconfig +16 -1
@@ -163,6 +163,17 @@ config USB_EHCI_HCD_OMAP Enables support for the on-chip EHCI controller on OMAP3 and later chips. +config USB_EHCI_HCD_ORION + tristate "Support for Marvell EBU on-chip EHCI USB controller" + depends on USB_EHCI_HCD && PLAT_ORION + default y + ---help--- + Enables support for the on-chip EHCI controller on Marvell's + embedded ARM SoCs, including Orion, Kirkwood, Dove, Armada XP, + Armada 370. This is different from the EHCI implementation + on Marvell's mobile PXA and MMP SoC, see "EHCI support for + Marvell PXA/MMP USB controller" for those. + config USB_EHCI_MSM bool "Support for MSM on-chip EHCI USB controller" depends on USB_EHCI_HCD && ARCH_MSM
@@ -206,13 +217,17 @@ config USB_EHCI_S5P Enable support for the S5P SOC's on-chip EHCI controller. config USB_EHCI_MV - bool "EHCI support for Marvell on-chip controller" + bool "EHCI support for Marvell PXA/MMP USB controller" depends on USB_EHCI_HCD && (ARCH_PXA || ARCH_MMP) select USB_EHCI_ROOT_HUB_TT ---help--- Enables support for Marvell (including PXA and MMP series) on-chip USB SPH and OTG controller. SPH is a single port host, and it can only be EHCI host. OTG is controller that can switch to host mode. + Note that this driver will not work on Marvell's other EHCI + controller used by the EBU-type SoCs including Orion, Kirkwood, + Dova, Armada 370 and Armada XP. See "Support for Marvell EBU + on-chip EHCI USB controller" for those. config USB_W90X900_EHCI bool "W90X900(W90P910) EHCI support"
drivers/usb/host/Makefile +1 -0
@@ -28,6 +28,7 @@ obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o +obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
drivers/usb/host/ehci-hcd.c +1 -5
@@ -1249,11 +1249,6 @@ MODULE_LICENSE ("GPL");#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 -#endif -#ifdef CONFIG_USB_W90X900_EHCI #include "ehci-w90x900.c" #define PLATFORM_DRIVER ehci_hcd_w90x900_driver
@@ -1319,6 +1314,7 @@ MODULE_LICENSE ("GPL"); !IS_ENABLED (CONFIG_USB_CHIPIDEA_HOST ) && \ !IS_ENABLED (CONFIG_USB_EHCI_MXC ) && \ !IS_ENABLED (CONFIG_USB_EHCI_HCD_OMAP ) && \ + !IS_ENABLED (CONFIG_USB_EHCI_HCD_ORION ) && \ !defined (PLATFORM_DRIVER ) && \ !defined (PS3_SYSTEM_BUS_DRIVER ) && \ !defined(OF_PLATFORM_DRIVER) && \
drivers/usb/host/ehci-orion.c +35 -47
109 lines not on this page · raw message
Signature · 1 line
1.8.1.2
v4 cover USB EHCI multiplatform conversion
Hi Alan,
This is a quick update to v3, addressing all issues you pointed in yesterday's review. Thanks for taking a thorough look on short notice on a public holiday!
Arnd
Arnd Bergmann (1):
USB: OHCI: avoid conflicting platform drivers
Manjunath Goudar (5):
USB: EHCI: make ehci-orion a separate driver
USB: EHCI: make ehci-spear a separate driver
USB: EHCI: make ehci-s5p a separate driver
USB: EHCI: make ehci-atmel a separate driver
USB: EHCI: make ehci-msm a separate driver
drivers/usb/host/Kconfig | 40 +++++++++-- drivers/usb/host/Makefile | 5 ++ drivers/usb/host/ehci-atmel.c | 88 +++++++++++------------ drivers/usb/host/ehci-hcd.c | 30 ++------ drivers/usb/host/ehci-msm.c | 85 ++++++++++------------ drivers/usb/host/ehci-orion.c | 82 +++++++++------------ drivers/usb/host/ehci-s5p.c | 164 +++++++++++++++++++++--------------------- drivers/usb/host/ehci-spear.c | 115 +++++++++++++---------------- drivers/usb/host/ohci-hcd.c | 136 ++++++++++++++++++++++++++++++----- 9 files changed, 408 insertions(+), 337 deletions(-)
Signature · 16 lines
1.8.1.2 Cc: Alan Stern <[email protected]> Cc: Bryan Huntsman <[email protected]> Cc: David Brown <[email protected]> Cc: Greg KH <[email protected]> Cc: Jean-Christophe Plagniol-Villard <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Nicolas Ferre <[email protected]> Cc: Shiraz Hashim <[email protected]> Cc: linux-arm-kernel at lists.infradead.org Cc: linux-kernel at vger.kernel.org Cc: linux-usb at vger.kernel.org Cc: spear-devel at list.st.com
PATCH v4 2/6 USB: EHCI: make ehci-spear a separate driver
From: Manjunath Goudar <[email protected]>
Separate the SPEAr host controller driver from ehci-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; however, note that other changes are still needed before SPEAr can be booted with a multi-platform kernel, but they are queued in the arm-soc tree for 3.10.
With the infrastructure added by Alan Stern in patch 3e0232039 "USB: EHCI: prepare to make ehci-hcd a library module", we can avoid this problem by turning a bus glue into a separate module, as we do here for the SPEAr bus glue.
In V4 (arnd):
- renamed all 'struct spear_ehci' pointers from 'ehci' to the less ambiguous 'sehci'.
- folded trivial spear_start_ehci/spear_stop_ehci functions into callers.
- brought back initialization of ehci->caps.
In V3:
- Detailed commit message added here about why this patch is required.
- Eliminated ehci_spear_setup routine because hcd registers can be directly set in the spear_ehci_hcd_drv_probe function.
- spear_overrides struct initialized.
- Converted to using .extra_priv_size for allocating spear_ehci, and updated all users of that structure.
- to_spear_ehci() macro modified for spear_ehci.
In V2:
- Replaced spear as SPEAr everywhere, leaving functions/variables/config options.
--- drivers/usb/host/Kconfig | 8 +++ drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-hcd.c | 6 +-- drivers/usb/host/ehci-spear.c | 115 +++++++++++++++++++----------------------- 4 files changed, 61 insertions(+), 69 deletions(-)
drivers/usb/host/Kconfig +8 -0
@@ -174,6 +174,14 @@ config USB_EHCI_HCD_ORION on Marvell's mobile PXA and MMP SoC, see "EHCI support for Marvell PXA/MMP USB controller" for those. +config USB_EHCI_HCD_SPEAR + tristate "Support for ST SPEAr on-chip EHCI USB controller" + depends on USB_EHCI_HCD && PLAT_SPEAR + default y + ---help--- + Enables support for the on-chip EHCI controller on + ST SPEAr chips. + config USB_EHCI_MSM bool "Support for MSM on-chip EHCI USB controller" depends on USB_EHCI_HCD && ARCH_MSM
drivers/usb/host/Makefile +1 -0
@@ -29,6 +29,7 @@ obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o +obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
drivers/usb/host/ehci-hcd.c +1 -5
@@ -1264,11 +1264,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_octeon_driver#endif -#ifdef CONFIG_PLAT_SPEAR -#include "ehci-spear.c" -#define PLATFORM_DRIVER spear_ehci_hcd_driver -#endif -#ifdef CONFIG_USB_EHCI_MSM #include "ehci-msm.c" #define PLATFORM_DRIVER ehci_msm_driver
@@ -1315,6 +1310,7 @@ MODULE_LICENSE ("GPL"); !IS_ENABLED (CONFIG_USB_EHCI_MXC ) && \ !IS_ENABLED (CONFIG_USB_EHCI_HCD_OMAP ) && \ !IS_ENABLED (CONFIG_USB_EHCI_HCD_ORION ) && \ + !IS_ENABLED (CONFIG_USB_EHCI_HCD_SPEAR ) && \ !defined (PLATFORM_DRIVER ) && \ !defined (PS3_SYSTEM_BUS_DRIVER ) && \ !defined(OF_PLATFORM_DRIVER) && \
drivers/usb/host/ehci-spear.c +51 -64
170 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v4 3/6 USB: EHCI: make ehci-s5p a separate driver
In reply to Arnd BergmannFrom: Manjunath Goudar <[email protected]>
Separate the Samsung S5P/EXYNOS host controller driver from ehci-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; however, note that other changes are still needed before S5P/EXYNOS can be booted with a multi-platform kernel. We currently expect those to get merged for 3.10.
With the infrastructure added by Alan Stern in patch 3e0232039 "USB: EHCI: prepare to make ehci-hcd a library module", we can avoid this problem by turning a bus glue into a separate module, as we do here for the s5p bus glue.
In V4 (arnd)
- revert some of the pointless changes.
- fix allocation of s5p specific data structure.
In V3:
-Detail commit message added here,why this patch is required.
-MODULE_LICENSE is GPL v2.
-Added .extra_priv_size to eliminate the separate allocation of the s5p_ehci_hcd structure
and removed .reset function pointer initialization.
-Arranged #include's in alphabetical order.
-After using extra_priv_size initialization,struct usb_hcd *hcd is redundant that's why removed
from the prob function.
-Eliminated s5p_ehci_phy_enable,contents of statements moved into the s5p_ehci_probe -Eliminated s5p_ehci_phy_disable, contents of statements moved into the s5p_ehci_remove.
In V2:
Tegra patch related changes removed from this patch.
--- drivers/usb/host/Kconfig | 5 +- drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-hcd.c | 6 +- drivers/usb/host/ehci-s5p.c | 164 +++++++++++++++++++++----------------------- 4 files changed, 85 insertions(+), 91 deletions(-)
drivers/usb/host/Kconfig +3 -2
@@ -219,10 +219,11 @@ config USB_EHCI_SH If you use the PCI EHCI controller, this option is not necessary. config USB_EHCI_S5P - boolean "S5P EHCI support" + tristate "EHCI support for Samsung S5P/EXYNOS SoC Series" depends on USB_EHCI_HCD && PLAT_S5P help - Enable support for the S5P SOC's on-chip EHCI controller. + Enable support for the Samsung S5Pxxxx and Exynos3/4/5 SOC's + on-chip EHCI controller. config USB_EHCI_MV bool "EHCI support for Marvell PXA/MMP USB controller"
drivers/usb/host/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o +obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
drivers/usb/host/ehci-hcd.c +1 -5
@@ -1284,11 +1284,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER tegra_ehci_driver#endif -#ifdef CONFIG_USB_EHCI_S5P -#include "ehci-s5p.c" -#define PLATFORM_DRIVER s5p_ehci_driver -#endif -#ifdef CONFIG_SPARC_LEON #include "ehci-grlib.c" #define PLATFORM_DRIVER ehci_grlib_driver
@@ -1311,6 +1306,7 @@ MODULE_LICENSE ("GPL"); !IS_ENABLED (CONFIG_USB_EHCI_HCD_OMAP ) && \ !IS_ENABLED (CONFIG_USB_EHCI_HCD_ORION ) && \ !IS_ENABLED (CONFIG_USB_EHCI_HCD_SPEAR ) && \ + !IS_ENABLED (CONFIG_USB_EHCI_S5P ) && \ !defined (PLATFORM_DRIVER ) && \ !defined (PS3_SYSTEM_BUS_DRIVER ) && \ !defined(OF_PLATFORM_DRIVER) && \
drivers/usb/host/ehci-s5p.c +80 -84
261 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v4 5/6 USB: EHCI: make ehci-msm a separate driver
In reply to Arnd BergmannFrom: Manjunath Goudar <[email protected]>
Separate the Qualcomm QSD/MSM on-chip host controller driver from ehci-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; however, note that other changes are still needed before Qualcomm QSD/MSM can be booted with a multi-platform kernel, which is not expected before 3.11.
With the infrastructure added by Alan Stern in patch 3e0232039 "USB: EHCI: prepare to make ehci-hcd a library module", we can avoid this problem by turning a bus glue into a separate module, as we do here for the msm bus glue.
In V3:
1.Detail commit message added here,why this patch is required.
2.Arranged #include's in alphabetical order.
3.drive.name initialized hcd_name[] = "ehci-msm" in platform_driver structure initialization
instead of "msm-ehci",that is reason it was breaking in EHCI USB testing.this one fixed in V3.
In V2:
Tegra patch related changes removed from this patch.
--- drivers/usb/host/Kconfig | 2 +- drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-hcd.c | 6 +--- drivers/usb/host/ehci-msm.c | 85 ++++++++++++++++++++------------------------- 4 files changed, 40 insertions(+), 54 deletions(-)
drivers/usb/host/Kconfig +1 -1
@@ -191,7 +191,7 @@ config USB_EHCI_HCD_AT91 Atmel chips. config USB_EHCI_MSM - bool "Support for MSM on-chip EHCI USB controller" + tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller" depends on USB_EHCI_HCD && ARCH_MSM select USB_EHCI_ROOT_HUB_TT select USB_MSM_OTG
drivers/usb/host/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o +obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
drivers/usb/host/ehci-hcd.c +1 -5
@@ -1259,11 +1259,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_octeon_driver#endif -#ifdef CONFIG_USB_EHCI_MSM -#include "ehci-msm.c" -#define PLATFORM_DRIVER ehci_msm_driver -#endif -#ifdef CONFIG_TILE_USB #include "ehci-tilegx.c" #define PLATFORM_DRIVER ehci_hcd_tilegx_driver
@@ -1303,6 +1298,7 @@ MODULE_LICENSE ("GPL"); !IS_ENABLED (CONFIG_USB_EHCI_HCD_SPEAR ) && \ !IS_ENABLED (CONFIG_USB_EHCI_S5P ) && \ !IS_ENABLED (CONFIG_USB_EHCI_HCD_AT91 ) && \ + !IS_ENABLED (CONFIG_USB_EHCI_MSM ) && \ !defined (PLATFORM_DRIVER ) && \ !defined (PS3_SYSTEM_BUS_DRIVER ) && \ !defined(OF_PLATFORM_DRIVER) && \
drivers/usb/host/ehci-msm.c +37 -48
108 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v4 4/6 USB: EHCI: make ehci-atmel a separate driver
In reply to Arnd BergmannFrom: Manjunath Goudar <[email protected]>
Separate the Atmel host controller driver from ehci-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; however, note that other changes are still needed before Atmel can be booted with a multi-platform kernel. This is currently planned for Linux-3.11.
With the infrastructure added by Alan Stern in patch 3e0232039 "USB: EHCI: prepare to make ehci-hcd a library module", we can avoid this problem by turning a bus glue into a separate module, as we do here for the Atmel bus glue.
In V4 (arnd):
- reordered #include statements.
- removed call to ehci_shutdown.
In V3:
-Detailed commit message added here about why this patch is required.
-Replaced hcd_name string "ehci-atmel" to "atmel-ehci".
-In Makefile inserted Blank line that separates the EHCI drivers from the following non-EHCI drivers. -Export ehci_shutdown symbol as it is needed by the Atmel driver.
-Eliminated ehci_atmel_setup routine beacuse hcd registers
directly setting in ehci_atmel_drv_probe function.
In V2:
Resolved below compiler error.drivers/usb/host/ehci-atmel.c: In function 'ehci_atmel_drv_remove':drivers/usb/host/ehci-atmel.c:167: error: implicit declaration of function 'ehci_shutdown'
--- drivers/usb/host/Kconfig | 8 ++++ drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-atmel.c | 88 ++++++++++++++++++++----------------------- drivers/usb/host/ehci-hcd.c | 6 +-- 4 files changed, 51 insertions(+), 52 deletions(-)
drivers/usb/host/Kconfig +8 -0
@@ -182,6 +182,14 @@ config USB_EHCI_HCD_SPEAR Enables support for the on-chip EHCI controller on ST SPEAr chips. +config USB_EHCI_HCD_AT91 + tristate "Support for Atmel on-chip EHCI USB controller" + depends on USB_EHCI_HCD && ARCH_AT91 + default y + ---help--- + Enables support for the on-chip EHCI controller on + Atmel chips. + config USB_EHCI_MSM bool "Support for MSM on-chip EHCI USB controller" depends on USB_EHCI_HCD && ARCH_MSM
drivers/usb/host/Makefile +1 -0
@@ -31,6 +31,7 @@ obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o +obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
drivers/usb/host/ehci-atmel.c +41 -47
123 lines not on this page · raw message
drivers/usb/host/ehci-hcd.c +1 -5
@@ -1254,11 +1254,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_hcd_w90x900_driver#endif -#ifdef CONFIG_ARCH_AT91 -#include "ehci-atmel.c" -#define PLATFORM_DRIVER ehci_atmel_driver -#endif -#ifdef CONFIG_USB_OCTEON_EHCI #include "ehci-octeon.c" #define PLATFORM_DRIVER ehci_octeon_driver
@@ -1307,6 +1302,7 @@ MODULE_LICENSE ("GPL"); !IS_ENABLED (CONFIG_USB_EHCI_HCD_ORION ) && \ !IS_ENABLED (CONFIG_USB_EHCI_HCD_SPEAR ) && \ !IS_ENABLED (CONFIG_USB_EHCI_S5P ) && \ + !IS_ENABLED (CONFIG_USB_EHCI_HCD_AT91 ) && \ !defined (PLATFORM_DRIVER ) && \ !defined (PS3_SYSTEM_BUS_DRIVER ) && \ !defined(OF_PLATFORM_DRIVER) && \
Signature · 1 line
1.8.1.2
PATCH v4 6/6 USB: OHCI: avoid conflicting platform drivers
In reply to Arnd BergmannLike the EHCI driver, OHCI supports a large number of different platform glue drivers by directly including them, which causes problems with conflicting macro definitions in some cases. As more ARM architecture specific back-ends are required to coexist in a single build, we should split those out into separate drivers. Unfortunately, the infrastructure for that is still under development, so to give us more time, this uses a separate *_PLATFORM_DRIVER macro for each ARM specific OHCI backend, just like we already do on PowerPC and some of the other ARM platforms.
In linux-3.10, only the SPEAr and CNS3xxx back-ends would actually conflict without this patch, but over time we would get more of them, so this is a way to avoid having to patch the driver every time it breaks. We should still split out all back-ends into separate loadable modules, but that work is only needed to improve code size and cleanliness after this patch, not for correctness.
While we're here, this fixes the incorrectly sorted error path for the OMAP1 and OMAP3 backends to ensure we always unregister the exact set of drivers that were registered before erroring out.
--- drivers/usb/host/ohci-hcd.c | 136 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 118 insertions(+), 18 deletions(-)
drivers/usb/host/ohci-hcd.c +118 -18
@@ -1102,12 +1102,12 @@ MODULE_LICENSE ("GPL");#if defined(CONFIG_ARCH_S3C24XX ) || defined(CONFIG_ARCH_S3C64XX )#include "ohci-s3c2410.c" -#define PLATFORM_DRIVER ohci_hcd_s3c2410_driver +#define S3C2410_PLATFORM_DRIVER ohci_hcd_s3c2410_driver#endif #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
@@ -1127,25 +1127,24 @@ MODULE_LICENSE ("GPL");#ifdef CONFIG_ARCH_EP93XX #include "ohci-ep93xx.c" -#define PLATFORM_DRIVER ohci_hcd_ep93xx_driver +#define EP93XX_PLATFORM_DRIVER ohci_hcd_ep93xx_driver#endif #ifdef CONFIG_ARCH_AT91 #include "ohci-at91.c" -#define PLATFORM_DRIVER ohci_hcd_at91_driver +#define AT91_PLATFORM_DRIVER ohci_hcd_at91_driver#endif #ifdef CONFIG_ARCH_LPC32XX #include "ohci-nxp.c" -#define PLATFORM_DRIVER usb_hcd_nxp_driver +#define NXP_PLATFORM_DRIVER usb_hcd_nxp_driver#endif #ifdef CONFIG_ARCH_DAVINCI_DA8XX #include "ohci-da8xx.c" -#define PLATFORM_DRIVER ohci_hcd_da8xx_driver +#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
@@ -1153,7 +1152,7 @@ MODULE_LICENSE ("GPL");#ifdef CONFIG_PLAT_SPEAR #include "ohci-spear.c" -#define PLATFORM_DRIVER spear_ohci_hcd_driver +#define SPEAR_PLATFORM_DRIVER spear_ohci_hcd_driver#endif #ifdef CONFIG_PPC_PS3
@@ -1199,7 +1198,14 @@ MODULE_LICENSE ("GPL"); !defined (SA1111_DRIVER ) && \ !defined (PS3_SYSTEM_BUS_DRIVER ) && \ !defined (SM501_OHCI_DRIVER ) && \ - !defined(TMIO_OHCI_DRIVER) + !defined (TMIO_OHCI_DRIVER ) && \ + !defined (S3C2410_PLATFORM_DRIVER ) && \ + !defined (EXYNOS_PLATFORM_DRIVER ) && \ + !defined (EP93XX_PLATFORM_DRIVER ) && \ + !defined (AT91_PLATFORM_DRIVER ) && \ + !defined (NXP_PLATFORM_DRIVER ) && \ + !defined (DAVINCI_PLATFORM_DRIVER ) && \ + !defined(SPEAR_PLATFORM_DRIVER)#error "missing bus glue for ohci-hcd"#endif
@@ -1277,9 +1283,79 @@ static int __init ohci_hcd_mod_init(void) goto error_tmio;#endif +#ifdef S3C2410_PLATFORM_DRIVER + retval =platform_driver_register (&S3C2410_PLATFORM_DRIVER ); +if (retval <0 ) + goto error_s3c2410; +#endif + +#ifdef EXYNOS_PLATFORM_DRIVER + retval =platform_driver_register (&EXYNOS_PLATFORM_DRIVER ); +if (retval <0 ) + goto error_exynos; +#endif + +#ifdef EP93XX_PLATFORM_DRIVER + retval =platform_driver_register (&EP93XX_PLATFORM_DRIVER ); +if (retval <0 ) + goto error_ep93xx; +#endif + +#ifdef AT91_PLATFORM_DRIVER + retval =platform_driver_register (&AT91_PLATFORM_DRIVER ); +if (retval <0 ) + goto error_at91; +#endif + +#ifdef NXP_PLATFORM_DRIVER + retval =platform_driver_register (&NXP_PLATFORM_DRIVER ); +if (retval <0 ) + goto error_nxp; +#endif + +#ifdef DAVINCI_PLATFORM_DRIVER + retval =platform_driver_register (&DAVINCI_PLATFORM_DRIVER ); +if (retval <0 ) + goto error_davinci; +#endif + +#ifdef SPEAR_PLATFORM_DRIVER + retval =platform_driver_register (&SPEAR_PLATFORM_DRIVER ); +if (retval <0 ) + goto error_spear; +#endif +return retval;/* Error path */ +#ifdef SPEAR_PLATFORM_DRIVER +platform_driver_unregister (&SPEAR_PLATFORM_DRIVER ); + error_spear: +#endif +#ifdef DAVINCI_PLATFORM_DRIVER +platform_driver_unregister (&DAVINCI_PLATFORM_DRIVER ); + error_davinci: +#endif +#ifdef NXP_PLATFORM_DRIVER +platform_driver_unregister (&NXP_PLATFORM_DRIVER ); + error_nxp: +#endif +#ifdef AT91_PLATFORM_DRIVER +platform_driver_unregister (&AT91_PLATFORM_DRIVER ); + error_at91: +#endif +#ifdef EP93XX_PLATFORM_DRIVER +platform_driver_unregister (&EP93XX_PLATFORM_DRIVER ); + error_ep93xx: +#endif +#ifdef EXYNOS_PLATFORM_DRIVER +platform_driver_unregister (&EXYNOS_PLATFORM_DRIVER ); + error_exynos: +#endif +#ifdef S3C2410_PLATFORM_DRIVER +platform_driver_unregister (&S3C2410_PLATFORM_DRIVER ); + error_s3c2410: +#endif #ifdef TMIO_OHCI_DRIVER platform_driver_unregister (&TMIO_OHCI_DRIVER ); error_tmio:
@@ -1300,17 +1376,17 @@ static int __init ohci_hcd_mod_init(void)platform_driver_unregister (&OF_PLATFORM_DRIVER ); error_of_platform:#endif -#ifdef PLATFORM_DRIVER -platform_driver_unregister (&PLATFORM_DRIVER ); - error_platform: +#ifdef OMAP3_PLATFORM_DRIVER +platform_driver_unregister (&OMAP3_PLATFORM_DRIVER ); + error_omap3_platform:#endif #ifdef OMAP1_PLATFORM_DRIVER platform_driver_unregister (&OMAP1_PLATFORM_DRIVER ); error_omap1_platform:#endif -#ifdef OMAP3_PLATFORM_DRIVER -platform_driver_unregister (&OMAP3_PLATFORM_DRIVER ); - error_omap3_platform: +#ifdef PLATFORM_DRIVER +platform_driver_unregister (&PLATFORM_DRIVER ); + error_platform:#endif #ifdef PS3_SYSTEM_BUS_DRIVER ps3_ohci_driver_unregister (&PS3_SYSTEM_BUS_DRIVER );
@@ -1329,6 +1405,27 @@ module_init(ohci_hcd_mod_init); static void __exit ohci_hcd_mod_exit(void) { +#ifdef SPEAR_PLATFORM_DRIVER +platform_driver_unregister (&SPEAR_PLATFORM_DRIVER ); +#endif +#ifdef DAVINCI_PLATFORM_DRIVER +platform_driver_unregister (&DAVINCI_PLATFORM_DRIVER ); +#endif +#ifdef NXP_PLATFORM_DRIVER +platform_driver_unregister (&NXP_PLATFORM_DRIVER ); +#endif +#ifdef AT91_PLATFORM_DRIVER +platform_driver_unregister (&AT91_PLATFORM_DRIVER ); +#endif +#ifdef EP93XX_PLATFORM_DRIVER +platform_driver_unregister (&EP93XX_PLATFORM_DRIVER ); +#endif +#ifdef EXYNOS_PLATFORM_DRIVER +platform_driver_unregister (&EXYNOS_PLATFORM_DRIVER ); +#endif +#ifdef S3C2410_PLATFORM_DRIVER +platform_driver_unregister (&S3C2410_PLATFORM_DRIVER ); +#endif #ifdef TMIO_OHCI_DRIVER platform_driver_unregister (&TMIO_OHCI_DRIVER );#endif
@@ -1344,12 +1441,15 @@ static void __exit ohci_hcd_mod_exit(void)#ifdef OF_PLATFORM_DRIVER platform_driver_unregister (&OF_PLATFORM_DRIVER );#endif -#ifdef PLATFORM_DRIVER -platform_driver_unregister (&PLATFORM_DRIVER ); -#endif #ifdef OMAP3_PLATFORM_DRIVER platform_driver_unregister (&OMAP3_PLATFORM_DRIVER );#endif +#ifdef OMAP1_PLATFORM_DRIVER +platform_driver_unregister (&OMAP1_PLATFORM_DRIVER ); +#endif +#ifdef PLATFORM_DRIVER +platform_driver_unregister (&PLATFORM_DRIVER ); +#endif #ifdef PS3_SYSTEM_BUS_DRIVER ps3_ohci_driver_unregister (&PS3_SYSTEM_BUS_DRIVER );#endif
Signature · 1 line
1.8.1.2