cleanup on resource check
Subsystems (11)
v4 cover cleanup on resource check
From: Varka Bhadram <[email protected]>
This series removes the duplication of sanity check for platform_get_resource() return resource. It will be checked with devm_ioremap_resource().
This entire series rebased on usb-next of [1].
changes since v1:
- removed broken patches
- added Ack of Alan Stern for all the ehci, ohci, and uhci changes.
changes since v2:
- addressed Sergei Shtylyov comments
changes since v3:
- separated as two serieses, one for fixes another for cleanup
- added Acked-by of Felipe balbi
- added Reviewed-by of Gregory CLEMENT
[1]: https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git
Varka Bhadram (27):
host: ehci-atmel: remove duplicate check on resource
host: ohci-da8xx: remove duplicate check on resource
host: ehci-tegra: remove duplicate check on resource
host: ehci-w90x900: remove duplicate check on resource
host: ohci-at91: remove duplicate check on resource
host: ohci-exynos: remove duplicate check on resource
host: ohci-jz4740: remove duplicate check on resource
host: ohci-octeon: remove duplicate check on resource
host: ohci-platform: remove duplicate check on resource
host: ohci-pxa27x: remove duplicate check on resource
host: ehci-sh: remove duplicate check on resource
host: ohci-spear: remove duplicate check on resource
host: ehci-msm: remove duplicate check on resource
host: ehci-mv: remove duplicate check on resource
host: ehci-mxc: remove duplicate check on resource
host: ehci-octeon: remove duplicate check on resource
host: ehci-orion: remove duplicate check on resource
host: ehci-platform: remove duplicate check on resource
host: ehci-spear: remove duplicate check on resource
host: xhci-plat: remove duplicate check on resource
musb: musb_core: remove duplicate check on resource
musb: musb_dsps: remove duplicate check on resource
phy: phy-rcar-usb: remove duplicate check on resource
dwc3: dwc3-keystone: remove duplicate check on resource
host: ehci-fsl: remove duplicate check on resource
host: ehci-exynos: remove duplicate check on resource
renesas_usbhs: common: remove duplicate check on resource
drivers/usb/dwc3/dwc3-keystone.c | 5 ----- drivers/usb/host/ehci-atmel.c | 13 +++---------- drivers/usb/host/ehci-exynos.c | 11 +++-------- drivers/usb/host/ehci-fsl.c | 12 +++--------- drivers/usb/host/ehci-msm.c | 10 ++-------- drivers/usb/host/ehci-mv.c | 12 ------------ drivers/usb/host/ehci-mxc.c | 11 ++--------- drivers/usb/host/ehci-octeon.c | 12 +++--------- drivers/usb/host/ehci-orion.c | 10 +--------- drivers/usb/host/ehci-platform.c | 12 ++++-------- drivers/usb/host/ehci-sh.c | 15 +++------------ drivers/usb/host/ehci-spear.c | 9 ++------- drivers/usb/host/ehci-tegra.c | 10 +++------- drivers/usb/host/ehci-w90x900.c | 13 +++---------- drivers/usb/host/ohci-at91.c | 11 +++-------- drivers/usb/host/ohci-da8xx.c | 7 ++----- drivers/usb/host/ohci-exynos.c | 10 ++-------- drivers/usb/host/ohci-jz4740.c | 13 +++---------- drivers/usb/host/ohci-octeon.c | 12 +++--------- drivers/usb/host/ohci-platform.c | 13 ++++--------- drivers/usb/host/ohci-pxa27x.c | 11 ++--------- drivers/usb/host/ohci-spear.c | 11 +++-------- drivers/usb/host/xhci-plat.c | 10 ++++------ drivers/usb/musb/musb_core.c | 4 ++-- drivers/usb/musb/musb_dsps.c | 3 --- drivers/usb/phy/phy-rcar-usb.c | 8 +++----- drivers/usb/renesas_usbhs/common.c | 4 ++-- 27 files changed, 65 insertions(+), 207 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v4 1/27 host: ehci-atmel: remove duplicate check on resource
From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-atmel.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/usb/host/ehci-atmel.c +3 -10
@@ -107,22 +107,15 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) } res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev, -"Found HC with no register addr. Check %s setup!\n" , -dev_name (&pdev->dev)); - retval = -ENODEV ; - goto fail_request_resource; - } - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); - hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { retval =PTR_ERR (hcd->regs); goto fail_request_resource; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); + iclk =devm_clk_get (&pdev->dev,"ehci_clk" );if (IS_ERR (iclk)) {dev_err (&pdev->dev,"Error getting interface clock\n" );
Signature · 1 line
1.7.9.5
PATCH v4 2/27 host: ohci-da8xx: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-da8xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/usb/host/ohci-da8xx.c +2 -5
@@ -313,16 +313,13 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver,return -ENOMEM ; mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem) -return -ENODEV ; - hcd->rsrc_start = mem->start; - hcd->rsrc_len =resource_size (mem); - hcd->regs =devm_ioremap_resource (&pdev->dev, mem);if (IS_ERR (hcd->regs)) { error =PTR_ERR (hcd->regs); goto err; } + hcd->rsrc_start = mem->start; + hcd->rsrc_len =resource_size (mem);ohci_hcd_init (hcd_to_ohci (hcd));
Signature · 1 line
1.7.9.5
PATCH v4 3/27 host: ehci-tegra: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-tegra.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/usb/host/ehci-tegra.c +3 -7
@@ -460,18 +460,14 @@ static int tegra_ehci_probe(struct platform_device *pdev) "nvidia,needs-double-reset"); res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev,"Failed to get I/O memory\n" ); - err = -ENXIO ; - goto cleanup_clk_en; - } - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { err =PTR_ERR (hcd->regs); goto cleanup_clk_en; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); + ehci->caps = hcd->regs +0x100 ; ehci->has_hostpc = soc_config->has_hostpc;
Signature · 1 line
1.7.9.5
PATCH v4 4/27 host: ehci-w90x900: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-w90x900.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/usb/host/ehci-w90x900.c +3 -10
@@ -42,27 +42,20 @@ static int usb_w90x900_probe(const struct hc_driver *driver,int retval =0 , irq;unsigned long val; - - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { - retval = -ENXIO ; - goto err1; - } - hcd =usb_create_hcd (driver, &pdev->dev,"w90x900 EHCI" );if (!hcd) { retval = -ENOMEM ; goto err1; } - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); - + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { retval =PTR_ERR (hcd->regs); goto err2; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); ehci =hcd_to_ehci (hcd); ehci->caps = hcd->regs;
Signature · 1 line
1.7.9.5
PATCH v4 5/27 host: ohci-at91: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-at91.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/usb/host/ohci-at91.c +3 -8
@@ -133,12 +133,6 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,struct resource *res;int irq; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_dbg (dev,"hcd probe: missing memory resource\n" ); -return -ENXIO ; - } - irq =platform_get_irq (pdev,0 );if (irq <0 ) {dev_dbg (dev,"hcd probe: missing irq resource\n" );
@@ -148,14 +142,15 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, hcd =usb_create_hcd (driver, dev,"at91" );if (!hcd)return -ENOMEM ; - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (dev, res);if (IS_ERR (hcd->regs)) { retval =PTR_ERR (hcd->regs); goto err; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); iclk =devm_clk_get (dev,"ohci_clk" );if (IS_ERR (iclk)) {
Signature · 1 line
1.7.9.5
PATCH v4 6/27 host: ohci-exynos: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-exynos.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/usb/host/ohci-exynos.c +2 -8
@@ -155,19 +155,13 @@ skip_phy: goto fail_clk; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev,"Failed to get I/O memory\n" ); - err = -ENXIO ; - goto fail_io; - } - - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { err =PTR_ERR (hcd->regs); goto fail_io; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); irq =platform_get_irq (pdev,0 );if (!irq) {
Signature · 1 line
1.7.9.5
PATCH v4 7/27 host: ohci-jz4740: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-jz4740.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/usb/host/ohci-jz4740.c +3 -10
@@ -153,13 +153,6 @@ static int jz4740_ohci_probe(struct platform_device *pdev)struct resource *res;int irq; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - -if (!res) { -dev_err (&pdev->dev,"Failed to get platform resource\n" ); -return -ENOENT ; - } - irq =platform_get_irq (pdev,0 );if (irq <0 ) {dev_err (&pdev->dev,"Failed to get platform irq\n" );
@@ -174,14 +167,14 @@ static int jz4740_ohci_probe(struct platform_device *pdev) jz4740_ohci =hcd_to_jz4740_hcd (hcd); - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); - + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { ret =PTR_ERR (hcd->regs); goto err_free; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); jz4740_ohci->clk =devm_clk_get (&pdev->dev,"uhc" );if (IS_ERR (jz4740_ohci->clk)) {
Signature · 1 line
1.7.9.5
PATCH v4 8/27 host: ohci-octeon: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-octeon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/usb/host/ohci-octeon.c +3 -9
@@ -120,12 +120,6 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev)return -ENODEV ; } - res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (res_mem ==NULL ) { -dev_err (&pdev->dev,"No register space assigned\n" ); -return -ENODEV ; - } -/* Ohci is a 32-bit device. */ ret =dma_coerce_mask_and_coherent (&pdev->dev,DMA_BIT_MASK (32 ));if (ret)
@@ -135,14 +129,14 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev)if (!hcd)return -ENOMEM ; - hcd->rsrc_start = res_mem->start; - hcd->rsrc_len =resource_size (res_mem); - + res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); reg_base =devm_ioremap_resource (&pdev->dev, res_mem);if (IS_ERR (reg_base)) { ret =PTR_ERR (reg_base); goto err1; } + hcd->rsrc_start = res_mem->start; + hcd->rsrc_len =resource_size (res_mem);ohci_octeon_hw_start ();
Signature · 1 line
1.7.9.5
PATCH v4 9/27 host: ohci-platform: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-platform.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/usb/host/ohci-platform.c +4 -9
@@ -134,12 +134,6 @@ static int ohci_platform_probe(struct platform_device *dev)return irq; } - res_mem =platform_get_resource (dev,IORESOURCE_MEM ,0 ); -if (!res_mem) { -dev_err (&dev->dev,"no memory resource provided" ); -return -ENXIO ; - } - hcd =usb_create_hcd (&ohci_platform_hc_driver, &dev->dev,dev_name (&dev->dev));if (!hcd)
@@ -231,14 +225,15 @@ static int ohci_platform_probe(struct platform_device *dev) goto err_reset; } - hcd->rsrc_start = res_mem->start; - hcd->rsrc_len =resource_size (res_mem); - + res_mem =platform_get_resource (dev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (&dev->dev, res_mem);if (IS_ERR (hcd->regs)) { err =PTR_ERR (hcd->regs); goto err_power; } + hcd->rsrc_start = res_mem->start; + hcd->rsrc_len =resource_size (res_mem); + err =usb_add_hcd (hcd, irq,IRQF_SHARED );if (err) goto err_power;
Signature · 1 line
1.7.9.5
PATCH v4 10/27 host: ohci-pxa27x: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-pxa27x.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/usb/host/ohci-pxa27x.c +2 -9
@@ -447,20 +447,13 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_devicereturn -ENOMEM ; r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!r) { -pr_err ("no resource of IORESOURCE_MEM" ); - retval = -ENXIO ; - goto err; - } - - hcd->rsrc_start = r->start; - hcd->rsrc_len =resource_size (r); - hcd->regs =devm_ioremap_resource (&pdev->dev, r);if (IS_ERR (hcd->regs)) { retval =PTR_ERR (hcd->regs); goto err; } + hcd->rsrc_start = r->start; + hcd->rsrc_len =resource_size (r);/* initialize "struct pxa27x_ohci" */ pxa_ohci =to_pxa27x_ohci (hcd);
Signature · 1 line
1.7.9.5
PATCH v4 11/27 host: ehci-sh: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-sh.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/usb/host/ehci-sh.c +3 -12
@@ -86,15 +86,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)if (usb_disabled ())return -ENODEV ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev, -"Found HC with no register addr. Check %s setup!\n" , -dev_name (&pdev->dev)); - ret = -ENODEV ; - goto fail_create_hcd; - } - irq =platform_get_irq (pdev,0 );if (irq <=0 ) { dev_err(&pdev->dev,
@@ -114,14 +105,14 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) goto fail_create_hcd; } - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); - + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { ret =PTR_ERR (hcd->regs); goto fail_request_resource; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); priv =devm_kzalloc (&pdev->dev,sizeof (struct ehci_sh_priv ),GFP_KERNEL );
Signature · 1 line
1.7.9.5
PATCH v4 12/27 host: ohci-spear: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ohci-spear.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/usb/host/ohci-spear.c +3 -8
@@ -74,20 +74,15 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) } res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { - retval = -ENODEV ; - goto err_put_hcd; - } - - hcd->rsrc_start = pdev->resource[0 ].start; - hcd->rsrc_len =resource_size (res); - hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { retval =PTR_ERR (hcd->regs); goto err_put_hcd; } + hcd->rsrc_start = pdev->resource[0 ].start; + hcd->rsrc_len =resource_size (res); + sohci_p =to_spear_ohci (hcd); sohci_p->clk = usbh_clk;
Signature · 1 line
1.7.9.5
PATCH v4 13/27 host: ehci-msm: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-msm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/usb/host/ehci-msm.c +2 -8
@@ -88,19 +88,13 @@ static int ehci_msm_probe(struct platform_device *pdev) } res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev,"Unable to get memory resource\n" ); - ret = -ENODEV ; - goto put_hcd; - } - - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { ret =PTR_ERR (hcd->regs); goto put_hcd; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res);/* * OTG driver takes care of PHY initialization, clock management,
Signature · 1 line
1.7.9.5
PATCH v4 14/27 host: ehci-mv: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-mv.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/usb/host/ehci-mv.c +0 -12
@@ -169,12 +169,6 @@ static int mv_ehci_probe(struct platform_device *pdev) } r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"phyregs" ); -if (r ==NULL ) { -dev_err (&pdev->dev,"no phy I/O memory resource defined\n" ); - retval = -ENODEV ; - goto err_put_hcd; - } - ehci_mv->phy_regs =devm_ioremap_resource (&pdev->dev, r);if (IS_ERR (ehci_mv->phy_regs)) { retval =PTR_ERR (ehci_mv->phy_regs);
@@ -182,12 +176,6 @@ static int mv_ehci_probe(struct platform_device *pdev) } r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"capregs" ); -if (!r) { -dev_err (&pdev->dev,"no I/O memory resource defined\n" ); - retval = -ENODEV ; - goto err_put_hcd; - } - ehci_mv->cap_regs =devm_ioremap_resource (&pdev->dev, r);if (IS_ERR (ehci_mv->cap_regs)) { retval =PTR_ERR (ehci_mv->cap_regs);
Signature · 1 line
1.7.9.5
PATCH v4 15/27 host: ehci-mxc: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-mxc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/usb/host/ehci-mxc.c +2 -9
@@ -69,20 +69,13 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)return -ENOMEM ; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"Found HC with no register addr. Check setup!\n" ); - ret = -ENODEV ; - goto err_alloc; - } - - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); - hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { ret =PTR_ERR (hcd->regs); goto err_alloc; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); hcd->has_tt =1 ; ehci =hcd_to_ehci (hcd);
Signature · 1 line
1.7.9.5
PATCH v4 16/27 host: ehci-octeon: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-octeon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/usb/host/ehci-octeon.c +3 -9
@@ -106,12 +106,6 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev)return -ENODEV ; } - res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (res_mem ==NULL ) { -dev_err (&pdev->dev,"No register space assigned\n" ); -return -ENODEV ; - } -/* * We can DMA from anywhere. But the descriptors must be in * the lower 4GB.
@@ -125,14 +119,14 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev)if (!hcd)return -ENOMEM ; - hcd->rsrc_start = res_mem->start; - hcd->rsrc_len =resource_size (res_mem); - + res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (&pdev->dev, res_mem);if (IS_ERR (hcd->regs)) { ret =PTR_ERR (hcd->regs); goto err1; } + hcd->rsrc_start = res_mem->start; + hcd->rsrc_len =resource_size (res_mem);ehci_octeon_start ();
Signature · 1 line
1.7.9.5
PATCH v4 17/27 host: ehci-orion: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-orion.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/usb/host/ehci-orion.c +1 -9
@@ -175,15 +175,6 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) goto err; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev, -"Found HC with no register addr. Check %s setup!\n" , -dev_name (&pdev->dev)); - err = -ENODEV ; - goto err; - } -/* * Right now device-tree probed devices don't get dma_mask * set. Since shared usb code relies on it, set it here for
@@ -193,6 +184,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)if (err) goto err; + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (regs)) { err =PTR_ERR (regs);
Signature · 1 line
1.7.9.5
PATCH v4 18/27 host: ehci-platform: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-platform.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/usb/host/ehci-platform.c +4 -8
@@ -164,11 +164,6 @@ static int ehci_platform_probe(struct platform_device *dev)dev_err (&dev->dev,"no irq provided" );return irq; } - res_mem =platform_get_resource (dev,IORESOURCE_MEM ,0 ); -if (!res_mem) { -dev_err (&dev->dev,"no memory resource provided" ); -return -ENXIO ; - } hcd =usb_create_hcd (&ehci_platform_hc_driver, &dev->dev,dev_name (&dev->dev));
@@ -250,14 +245,15 @@ static int ehci_platform_probe(struct platform_device *dev) goto err_reset; } - hcd->rsrc_start = res_mem->start; - hcd->rsrc_len =resource_size (res_mem); - + res_mem =platform_get_resource (dev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (&dev->dev, res_mem);if (IS_ERR (hcd->regs)) { err =PTR_ERR (hcd->regs); goto err_power; } + hcd->rsrc_start = res_mem->start; + hcd->rsrc_len =resource_size (res_mem); + err =usb_add_hcd (hcd, irq,IRQF_SHARED );if (err) goto err_power;
Signature · 1 line
1.7.9.5
PATCH v4 19/27 host: ehci-spear: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-spear.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/usb/host/ehci-spear.c +2 -7
@@ -99,18 +99,13 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) } res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { - retval = -ENODEV ; - goto err_put_hcd; - } - - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { retval =PTR_ERR (hcd->regs); goto err_put_hcd; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); sehci =to_spear_ehci (hcd); sehci->clk = usbh_clk;
Signature · 1 line
1.7.9.5
PATCH v4 20/27 host: xhci-plat: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/xhci-plat.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/usb/host/xhci-plat.c +4 -6
@@ -83,9 +83,6 @@ static int xhci_plat_probe(struct platform_device *pdev)if (irq <0 )return -ENODEV ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) -return -ENODEV ; if (of_device_is_compatible(pdev->dev.of_node, "marvell,armada-375-xhci") ||
@@ -109,15 +106,16 @@ static int xhci_plat_probe(struct platform_device *pdev)if (!hcd)return -ENOMEM ; - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); - + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { ret =PTR_ERR (hcd->regs); goto put_hcd; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); +/* * Not all platforms have a clk so it is not an error if the * clock does not exists.
Signature · 1 line
1.7.9.5
PATCH v4 21/27 musb: musb_core: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/musb/musb_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +2 -2
@@ -2080,10 +2080,10 @@ static int musb_probe(struct platform_device *pdev)struct resource *iomem;void __iomem *base; - iomem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!iomem || irq <=0 ) +if (irq <=0 )return -ENODEV ; + iomem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); base =devm_ioremap_resource (dev, iomem);if (IS_ERR (base))return PTR_ERR (base);
Signature · 1 line
1.7.9.5
PATCH v4 22/27 musb: musb_dsps: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/musb/musb_dsps.c | 3 --- 1 file changed, 3 deletions(-)
drivers/usb/musb/musb_dsps.c +0 -3
@@ -447,9 +447,6 @@ static int dsps_musb_init(struct musb *musb)int ret; r =platform_get_resource_byname (parent,IORESOURCE_MEM ,"control" ); -if (!r) -return -EINVAL ; - reg_base =devm_ioremap_resource (dev, r);if (IS_ERR (reg_base))return PTR_ERR (reg_base);
Signature · 1 line
1.7.9.5
PATCH v4 23/27 phy: phy-rcar-usb: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/phy/phy-rcar-usb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/usb/phy/phy-rcar-usb.c +3 -5
@@ -195,11 +195,9 @@ static int rcar_usb_phy_probe(struct platform_device *pdev)return PTR_ERR (reg0); res1 =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); -if (res1) { - reg1 =devm_ioremap_resource (dev, res1); -if (IS_ERR (reg1)) -return PTR_ERR (reg1); - } + reg1 =devm_ioremap_resource (dev, res1); +if (IS_ERR (reg1)) +return PTR_ERR (reg1); priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );if (!priv) {
Signature · 1 line
1.7.9.5
PATCH v4 24/27 dwc3: dwc3-keystone: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/dwc3/dwc3-keystone.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/usb/dwc3/dwc3-keystone.c +0 -5
@@ -104,11 +104,6 @@ static int kdwc3_probe(struct platform_device *pdev) kdwc->dev = dev; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"missing usbss resource\n" ); -return -EINVAL ; - } - kdwc->usbss =devm_ioremap_resource (dev, res);if (IS_ERR (kdwc->usbss))return PTR_ERR (kdwc->usbss);
Signature · 1 line
1.7.9.5
PATCH v4 25/27 host: ehci-fsl: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-fsl.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/usb/host/ehci-fsl.c +3 -9
@@ -93,21 +93,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, } res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev, -"Found HC with no register addr. Check %s setup!\n" , -dev_name (&pdev->dev)); - retval = -ENODEV ; - goto err2; - } - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { retval =PTR_ERR (hcd->regs); goto err2; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); + pdata->regs = hcd->regs;if (pdata->power_budget)
Signature · 1 line
1.7.9.5
PATCH v4 26/27 host: ehci-exynos: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/host/ehci-exynos.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/usb/host/ehci-exynos.c +3 -8
@@ -187,20 +187,15 @@ skip_phy: goto fail_clk; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&pdev->dev,"Failed to get I/O memory\n" ); - err = -ENXIO ; - goto fail_io; - } - - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); hcd->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (hcd->regs)) { err =PTR_ERR (hcd->regs); goto fail_io; } + hcd->rsrc_start = res->start; + hcd->rsrc_len =resource_size (res); + irq =platform_get_irq (pdev,0 );if (!irq) {dev_err (&pdev->dev,"Failed to get IRQ\n" );
Signature · 1 line
1.7.9.5
PATCH v4 27/27 renesas_usbhs: common: remove duplicate check on resource
In reply to [email protected]From: Varka Bhadram <[email protected]>
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/usb/renesas_usbhs/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/renesas_usbhs/common.c +2 -2
@@ -496,9 +496,8 @@ static int usbhs_probe(struct platform_device *pdev) }/* platform data */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); irq_res =platform_get_resource (pdev,IORESOURCE_IRQ ,0 ); -if (!res || !irq_res) { +if (!irq_res) {dev_err (&pdev->dev,"Not enough Renesas USB platform resources.\n" );return -ENODEV ; }
@@ -508,6 +507,7 @@ static int usbhs_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); priv->base =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (priv->base))return PTR_ERR (priv->base);
Signature · 1 line
1.7.9.5