USB: host: Remove non-DT support for Exynos EHCI and OHCI
Subsystems (6)
v2 cover USB: host: Remove non-DT support for Exynos EHCI and OHCI
This patchset removes non-DT support for Exynos EHCI and OHCI from arch and driver directories, because the non-DT for EXYNOS SoCs is not supported from v3.11. Also, missing usb_put_hcd() is added to prevent memory leak.
In order to keep the consistency, ehci-s5p.c is changed to ehci-exynos.c. So, the names of Exynos EHCI and OHCI drivers are as below:
- ehci-exynos.c
- ohci-exynos.c
In order to prevent build error issues or merge conflict,
this patchset includes the following patches that were
previously submitted.
- [PATCH] ARM: SAMSUNG: Remove unused s5p_device_ehci
(http://www.spinics.net/lists/linux-samsung-soc/msg23397.html)
- [PATCH] USB: ohci-exynos: Add missing usb_put_hcd() to prevent memory leak
(http://www.spinics.net/lists/linux-usb/msg95282.html)
These patches were tested on Exynos5250.
Changes from v1:
* Changed the order of patches in order to avoid unnecessary code churn
Jingoo Han (5)
ARM: SAMSUNG: Remove unused s5p_device_ehci
USB: ehci-s5p: Remove non-DT support
USB: ohci-exynos: Remove non-DT support
USB: ohci-exynos: Add missing usb_put_hcd()
USB: host: Rename ehci-s5p to ehci-exynos
---
arch/arm/plat-samsung/Kconfig | 5 -
arch/arm/plat-samsung/devs.c | 34 -----
arch/arm/plat-samsung/include/plat/devs.h | 1 -
drivers/usb/host/Kconfig | 5 +-
drivers/usb/host/Makefile | 2 +-
drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} | 164 ++++++++++--------------
drivers/usb/host/ohci-exynos.c | 17 +--
include/linux/platform_data/usb-ehci-s5p.h | 21 ---
include/linux/platform_data/usb-ohci-exynos.h | 21 ---
9 files changed, 76 insertions(+), 194 deletions(-)
rename drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} (55%)
delete mode 100644 include/linux/platform_data/usb-ehci-s5p.h
delete mode 100644 include/linux/platform_data/usb-ohci-exynos.hPATCH v2 1/5 ARM: SAMSUNG: Remove unused s5p_device_ehci
Since commit ca91435 "ARM: EXYNOS: Remove unused board files", s5p_device_ehci is not used anymore. Thus, s5p_device_ehci can be removed. Also, unnecessary S5P_DEV_USB_EHCI option is removed.
--- arch/arm/plat-samsung/Kconfig | 5 ----- arch/arm/plat-samsung/devs.c | 34 ----------------------------- arch/arm/plat-samsung/include/plat/devs.h | 1 - 3 files changed, 40 deletions(-)
arch/arm/plat-samsung/Kconfig +0 -5
@@ -382,11 +382,6 @@ config S5P_DEV_TV help Compile in platform device definition for TV interface -config S5P_DEV_USB_EHCI - bool - help - Compile in platform device definition for USB EHCI - config S3C24XX_PWM bool "PWM device support" select PWM
arch/arm/plat-samsung/devs.c +0 -34
@@ -49,7 +49,6 @@#include <plat/devs.h> #include <plat/adc.h> #include <linux/platform_data/ata-samsung_cf.h> -#include <linux/platform_data/usb-ehci-s5p.h> #include <plat/fb.h> #include <plat/fb-s3c2410.h> #include <plat/hdmi.h>
@@ -1359,39 +1358,6 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) }#endif /* CONFIG_PLAT_S3C24XX */ -/* USB EHCI Host Controller */ - -#ifdef CONFIG_S5P_DEV_USB_EHCI -static struct resource s5p_ehci_resource[] = { - [0 ] =DEFINE_RES_MEM (S5P_PA_EHCI ,SZ_256 ), - [1 ] =DEFINE_RES_IRQ (IRQ_USB_HOST ), -}; - -struct platform_device s5p_device_ehci = { - .name ="s5p-ehci" , - .id =-1 , - .num_resources =ARRAY_SIZE (s5p_ehci_resource), - .resource = s5p_ehci_resource, - .dev = { - .dma_mask = &samsung_device_dma_mask, - .coherent_dma_mask =DMA_BIT_MASK (32 ), - } -}; - -void __init s5p_ehci_set_platdata (struct s5p_ehci_platdata *pd) -{ -struct s5p_ehci_platdata *npd; - - npd =s3c_set_platdata (pd,sizeof (struct s5p_ehci_platdata ), - &s5p_device_ehci); - -if (!npd->phy_init) - npd->phy_init = s5p_usb_phy_init; -if (!npd->phy_exit) - npd->phy_exit = s5p_usb_phy_exit; -} -#endif /* CONFIG_S5P_DEV_USB_EHCI */ -/* USB HSOTG */ #ifdef CONFIG_S3C_DEV_USB_HSOTG
arch/arm/plat-samsung/include/plat/devs.h +0 -1
@@ -75,7 +75,6 @@ extern struct platform_device s3c_device_usb_hsotg;extern struct platform_device s3c_device_usb_hsudc;extern struct platform_device s3c_device_wdt; -extern struct platform_device s5p_device_ehci;extern struct platform_device s5p_device_fimc0;extern struct platform_device s5p_device_fimc1;extern struct platform_device s5p_device_fimc2;
Signature · 1 line
1.7.10.4
PATCH v2 2/5 USB: ehci-s5p: Remove non-DT support
In reply to Jingoo HanThe non-DT for EXYNOS SoCs is not supported from v3.11. Thus, there is no need to support non-DT for Exynos EHCI driver.
The 'include/linux/platform_data/usb-ehci-s5p.h' file has been used for non-DT support. Thus, the 'usb-ehci-s5p.h' file can be removed.
--- drivers/usb/host/ehci-s5p.c | 32 ++++------------------------ include/linux/platform_data/usb-ehci-s5p.h | 21 ------------------ 2 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 include/linux/platform_data/usb-ehci-s5p.h
drivers/usb/host/ehci-s5p.c +4 -28
@@ -20,7 +20,6 @@#include <linux/of.h> #include <linux/of_gpio.h> #include <linux/platform_device.h> -#include <linux/platform_data/usb-ehci-s5p.h> #include <linux/usb/phy.h> #include <linux/usb/samsung_usb_phy.h> #include <linux/usb.h>
@@ -47,11 +46,8 @@ struct s5p_ehci_hcd {struct clk *clk;struct usb_phy *phy;struct usb_otg *otg; -struct s5p_ehci_platdata *pdata; }; -static struct s5p_ehci_platdata empty_platdata; -#define to_s5p_ehci (hcd) (struct s5p_ehci_hcd *)(hcd_to_ehci(hcd)->priv)static void s5p_setup_vbus_gpio (struct platform_device *pdev)
@@ -75,7 +71,6 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev)static int s5p_ehci_probe (struct platform_device *pdev) { -struct s5p_ehci_platdata *pdata =dev_get_platdata (&pdev->dev);struct s5p_ehci_hcd *s5p_ehci;struct usb_hcd *hcd;struct ehci_hcd *ehci;
@@ -105,21 +100,14 @@ static int s5p_ehci_probe(struct platform_device *pdev) s5p_ehci =to_s5p_ehci (hcd);if (of_device_is_compatible (pdev->dev.of_node, -"samsung,exynos5440-ehci" )) { - s5p_ehci->pdata = &empty_platdata; +"samsung,exynos5440-ehci" )) goto skip_phy; - } phy =devm_usb_get_phy (&pdev->dev,USB_PHY_TYPE_USB2 );if (IS_ERR (phy)) { -/* Fallback to pdata */ -if (!pdata) { -usb_put_hcd (hcd); -dev_warn (&pdev->dev,"no platform data or transceiver defined\n" ); -return -EPROBE_DEFER ; - }else { - s5p_ehci->pdata = pdata; - } +usb_put_hcd (hcd); +dev_warn (&pdev->dev,"no platform data or transceiver defined\n" ); +return -EPROBE_DEFER ; }else { s5p_ehci->phy = phy; s5p_ehci->otg = phy->otg;
@@ -167,8 +155,6 @@ skip_phy:if (s5p_ehci->phy)usb_phy_init (s5p_ehci->phy); -else if (s5p_ehci->pdata->phy_init) - s5p_ehci->pdata->phy_init (pdev,USB_PHY_TYPE_HOST ); ehci =hcd_to_ehci (hcd); ehci->caps = hcd->regs;
@@ -189,8 +175,6 @@ skip_phy: fail_add_hcd:if (s5p_ehci->phy)usb_phy_shutdown (s5p_ehci->phy); -else if (s5p_ehci->pdata->phy_exit) - s5p_ehci->pdata->phy_exit (pdev,USB_PHY_TYPE_HOST ); fail_io:clk_disable_unprepare (s5p_ehci->clk); fail_clk:
@@ -210,8 +194,6 @@ static int s5p_ehci_remove(struct platform_device *pdev)if (s5p_ehci->phy)usb_phy_shutdown (s5p_ehci->phy); -else if (s5p_ehci->pdata->phy_exit) - s5p_ehci->pdata->phy_exit (pdev,USB_PHY_TYPE_HOST );clk_disable_unprepare (s5p_ehci->clk);
@@ -225,7 +207,6 @@ static int s5p_ehci_suspend(struct device *dev) {struct usb_hcd *hcd =dev_get_drvdata (dev);struct s5p_ehci_hcd *s5p_ehci =to_s5p_ehci (hcd); -struct platform_device *pdev =to_platform_device (dev);bool do_wakeup =device_may_wakeup (dev);int rc;
@@ -237,8 +218,6 @@ static int s5p_ehci_suspend(struct device *dev)if (s5p_ehci->phy)usb_phy_shutdown (s5p_ehci->phy); -else if (s5p_ehci->pdata->phy_exit) - s5p_ehci->pdata->phy_exit (pdev,USB_PHY_TYPE_HOST );clk_disable_unprepare (s5p_ehci->clk);
@@ -249,7 +228,6 @@ static int s5p_ehci_resume(struct device *dev) {struct usb_hcd *hcd =dev_get_drvdata (dev);struct s5p_ehci_hcd *s5p_ehci =to_s5p_ehci (hcd); -struct platform_device *pdev =to_platform_device (dev);clk_prepare_enable (s5p_ehci->clk);
@@ -258,8 +236,6 @@ static int s5p_ehci_resume(struct device *dev)if (s5p_ehci->phy)usb_phy_init (s5p_ehci->phy); -else if (s5p_ehci->pdata->phy_init) - s5p_ehci->pdata->phy_init (pdev,USB_PHY_TYPE_HOST );/* DMA burst Enable */ writel (EHCI_INSNREG00_ENABLE_DMA_BURST ,EHCI_INSNREG00 (hcd->regs));
include/linux/platform_data/usb-ehci-s5p.h deleted +0 -21
@@ -1,21 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics Co.Ltd -* Author: Joonyoung Shim <[email protected]> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -*/ - -#ifndef __PLAT_SAMSUNG_EHCI_H -#define __PLAT_SAMSUNG_EHCI_H __FILE__ - -struct s5p_ehci_platdata { -int (*phy_init)(struct platform_device *pdev,int type); -int (*phy_exit)(struct platform_device *pdev,int type); -}; - -extern void s5p_ehci_set_platdata (struct s5p_ehci_platdata *pd); - -#endif /* __PLAT_SAMSUNG_EHCI_H */
Signature · 1 line
1.7.10.4
PATCH v2 3/5 USB: ohci-exynos: Remove non-DT support
In reply to a message not in the archiveThe non-DT for EXYNOS SoCs is not supported from v3.11. Thus, there is no need to support non-DT for Exynos OHCI driver.
The 'include/linux/platform_data/usb-ohci-exynos.h' file has been used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can be removed.
--- drivers/usb/host/ohci-exynos.c | 16 ++-------------- include/linux/platform_data/usb-ohci-exynos.h | 21 --------------------- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 include/linux/platform_data/usb-ohci-exynos.h
drivers/usb/host/ohci-exynos.c +2 -14
@@ -18,7 +18,6 @@#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> -#include <linux/platform_data/usb-ohci-exynos.h> #include <linux/usb/phy.h> #include <linux/usb/samsung_usb_phy.h> #include <linux/usb.h>
@@ -38,7 +37,6 @@ struct exynos_ohci_hcd {struct clk *clk;struct usb_phy *phy;struct usb_otg *otg; -struct exynos4_ohci_platdata *pdata; };static void exynos_ohci_phy_enable (struct platform_device *pdev)
@@ -48,8 +46,6 @@ static void exynos_ohci_phy_enable(struct platform_device *pdev)if (exynos_ohci->phy)usb_phy_init (exynos_ohci->phy); -else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_init) - exynos_ohci->pdata->phy_init (pdev,USB_PHY_TYPE_HOST ); }static void exynos_ohci_phy_disable (struct platform_device *pdev)
@@ -59,13 +55,10 @@ static void exynos_ohci_phy_disable(struct platform_device *pdev)if (exynos_ohci->phy)usb_phy_shutdown (exynos_ohci->phy); -else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_exit) - exynos_ohci->pdata->phy_exit (pdev,USB_PHY_TYPE_HOST ); }static int exynos_ohci_probe (struct platform_device *pdev) { -struct exynos4_ohci_platdata *pdata =dev_get_platdata (&pdev->dev);struct exynos_ohci_hcd *exynos_ohci;struct usb_hcd *hcd;struct resource *res;
@@ -98,13 +91,8 @@ static int exynos_ohci_probe(struct platform_device *pdev) phy =devm_usb_get_phy (&pdev->dev,USB_PHY_TYPE_USB2 );if (IS_ERR (phy)) { -/* Fallback to pdata */ -if (!pdata) { -dev_warn (&pdev->dev,"no platform data or transceiver defined\n" ); -return -EPROBE_DEFER ; - }else { - exynos_ohci->pdata = pdata; - } +dev_warn (&pdev->dev,"no platform data or transceiver defined\n" ); +return -EPROBE_DEFER ; }else { exynos_ohci->phy = phy; exynos_ohci->otg = phy->otg;
include/linux/platform_data/usb-ohci-exynos.h deleted +0 -19
@@ -1,21 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics Co.Ltd -* http://www.samsung.com/ -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -*/ - -#ifndef __MACH_EXYNOS_OHCI_H -#define __MACH_EXYNOS_OHCI_H - -struct exynos4_ohci_platdata { -int (*phy_init)(struct platform_device *pdev,int type); -int (*phy_exit)(struct platform_device *pdev,int type); -}; - -extern void exynos4_ohci_set_platdata (struct exynos4_ohci_platdata *pd);
PATCH v2 4/5 USB: ohci-exynos: Add missing usb_put_hcd()
In reply to Jingoo HanWhen devm_usb_get_phy() fails, usb_put_hcd() should be called to prevent memory leak.
--- drivers/usb/host/ohci-exynos.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-exynos.c +1 -0
@@ -91,6 +91,7 @@ static int exynos_ohci_probe(struct platform_device *pdev) phy =devm_usb_get_phy (&pdev->dev,USB_PHY_TYPE_USB2 );if (IS_ERR (phy)) { +usb_put_hcd (hcd);dev_warn (&pdev->dev,"no platform data or transceiver defined\n" );return -EPROBE_DEFER ; }else {
Signature · 1 line
1.7.10.4
PATCH v2 5/5 USB: host: Rename ehci-s5p to ehci-exynos
In reply to Jingoo HanCurrently, Samsung is using 'EXYNOS' as the name of Samsung SoCs. Thus, ehci-exynos is preferred than ehci-s5p.
---
drivers/usb/host/Kconfig | 5 +-
drivers/usb/host/Makefile | 2 +-
drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} | 132 ++++++++++++------------
3 files changed, 69 insertions(+), 70 deletions(-)
rename drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} (62%)drivers/usb/host/Kconfig +2 -3
@@ -203,12 +203,11 @@ config USB_EHCI_SH Enables support for the on-chip EHCI controller on the SuperH. If you use the PCI EHCI controller, this option is not necessary. -config USB_EHCI_S5P +config USB_EHCI_EXYNOS tristate "EHCI support for Samsung S5P/EXYNOS SoC Series" depends on PLAT_S5P || ARCH_EXYNOS help - Enable support for the Samsung S5Pxxxx and Exynos3/4/5 SOC's - on-chip EHCI controller. + Enable support for the Samsung Exynos SOC's on-chip EHCI controller. config USB_EHCI_MV bool "EHCI support for Marvell PXA/MMP USB controller"
drivers/usb/host/Makefile +1 -1
@@ -34,7 +34,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_EHCI_EXYNOS) += ehci-exynos.o obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
drivers/usb/host/ehci-exynos.c renamed from drivers/usb/host/ehci-s5p.c +66 -66
273 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Re: [PATCH V2 3/5] USB: ohci-exynos: Remove non-DT support
In reply to a message not in the archiveQuoted 8 lines · Jingoo Han
The non-DT for EXYNOS SoCs is not supported from v3.11. Thus, there is no need to support non-DT for Exynos OHCI driver.
The '
include/linux/platform_data/usb-ohci-exynos.h' file has been used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can be removed.Signed-off-by Jingoo Han <[email protected]>
This patch fails to apply to my tree for some reason:
checking file drivers/usb/host/ohci-exynos.c Hunk #5 FAILED at 91.
1 out of 5 hunks FAILED
checking file include/linux/platform_data/usb-ohci-exynos.h
Can you redo it against my usb-next usb.git tree and resend it?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
'Greg Kroah-Hartman'
maintainerRe: [PATCH V2 4/5] USB: ohci-exynos: Add missing usb_put_hcd()
In reply to Jingoo HanQuoted 4 lines · Jingoo Han
When
devm_usb_get_phy()fails,usb_put_hcd()should be called to prevent memory leak.Signed-off-by Jingoo Han <[email protected]>
Already applied this one, thanks.
greg k-h
PATCH v3 1/1 USB: ohci-exynos: Remove non-DT support
In reply to 'Greg Kroah-Hartman'The non-DT for EXYNOS SoCs is not supported from v3.11. Thus, there is no need to support non-DT for Exynos OHCI driver.
The 'include/linux/platform_data/usb-ohci-exynos.h' file has been used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can be removed.
---
- re-based against the latest 'usb-next' branch.
drivers/usb/host/ohci-exynos.c | 18 +++--------------- include/linux/platform_data/usb-ohci-exynos.h | 21 --------------------- 2 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 include/linux/platform_data/usb-ohci-exynos.h
drivers/usb/host/ohci-exynos.c +3 -15
@@ -18,7 +18,6 @@#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> -#include <linux/platform_data/usb-ohci-exynos.h> #include <linux/usb/phy.h> #include <linux/usb/samsung_usb_phy.h> #include <linux/usb.h>
@@ -38,7 +37,6 @@ struct exynos_ohci_hcd {struct clk *clk;struct usb_phy *phy;struct usb_otg *otg; -struct exynos4_ohci_platdata *pdata; };static void exynos_ohci_phy_enable (struct platform_device *pdev)
@@ -48,8 +46,6 @@ static void exynos_ohci_phy_enable(struct platform_device *pdev)if (exynos_ohci->phy)usb_phy_init (exynos_ohci->phy); -else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_init) - exynos_ohci->pdata->phy_init (pdev,USB_PHY_TYPE_HOST ); }static void exynos_ohci_phy_disable (struct platform_device *pdev)
@@ -59,13 +55,10 @@ static void exynos_ohci_phy_disable(struct platform_device *pdev)if (exynos_ohci->phy)usb_phy_shutdown (exynos_ohci->phy); -else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_exit) - exynos_ohci->pdata->phy_exit (pdev,USB_PHY_TYPE_HOST ); }static int exynos_ohci_probe (struct platform_device *pdev) { -struct exynos4_ohci_platdata *pdata =dev_get_platdata (&pdev->dev);struct exynos_ohci_hcd *exynos_ohci;struct usb_hcd *hcd;struct resource *res;
@@ -98,14 +91,9 @@ static int exynos_ohci_probe(struct platform_device *pdev) phy =devm_usb_get_phy (&pdev->dev,USB_PHY_TYPE_USB2 );if (IS_ERR (phy)) { -/* Fallback to pdata */ -if (!pdata) { -usb_put_hcd (hcd); -dev_warn (&pdev->dev,"no platform data or transceiver defined\n" ); -return -EPROBE_DEFER ; - }else { - exynos_ohci->pdata = pdata; - } +usb_put_hcd (hcd); +dev_warn (&pdev->dev,"no platform data or transceiver defined\n" ); +return -EPROBE_DEFER ; }else { exynos_ohci->phy = phy; exynos_ohci->otg = phy->otg;
include/linux/platform_data/usb-ohci-exynos.h deleted +0 -21
@@ -1,21 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics Co.Ltd -* http://www.samsung.com/ -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -*/ - -#ifndef __MACH_EXYNOS_OHCI_H -#define __MACH_EXYNOS_OHCI_H - -struct exynos4_ohci_platdata { -int (*phy_init)(struct platform_device *pdev,int type); -int (*phy_exit)(struct platform_device *pdev,int type); -}; - -extern void exynos4_ohci_set_platdata (struct exynos4_ohci_platdata *pd); - -#endif /* __MACH_EXYNOS_OHCI_H */
Signature · 1 line
1.7.10.4