* [PATCH 1/6] usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 9:56 [PATCH 0/6] usb: host: Cleanup for ioremap'ing hcd memory Vivek Gautam
@ 2014-05-10 9:56 ` Vivek Gautam
2014-05-10 10:06 ` Alexander Shiyan
2014-05-10 9:56 ` [PATCH 2/6] usb: host: ehci-msm: " Vivek Gautam
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:56 UTC (permalink / raw)
To: linux-usb
Cc: linux-samsung-soc, linux-tegra, linux-kernel, linux-arm-kernel,
gregkh, stern, swarren, kgene.kim, thierry.reding, Vivek Gautam
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
drivers/usb/host/ehci-exynos.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index 7f425ac..bccb6f1 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -135,9 +135,8 @@ skip_phy:
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
- hcd->regs = devm_ioremap(&pdev->dev, res->start, hcd->rsrc_len);
+ hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (!hcd->regs) {
- dev_err(&pdev->dev, "Failed to remap I/O memory\n");
err = -ENOMEM;
goto fail_io;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 1/6] usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 9:56 ` [PATCH 1/6] usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap Vivek Gautam
@ 2014-05-10 10:06 ` Alexander Shiyan
[not found] ` <1399716396.580639659-iE7NquU0hAtsdVUOrk1QfQ@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Shiyan @ 2014-05-10 10:06 UTC (permalink / raw)
To: Vivek Gautam
Cc: linux-samsung-soc, swarren, gregkh, linux-kernel, kgene.kim,
stern, linux-tegra, thierry.reding, linux-arm-kernel, linux-usb
Sat, 10 May 2014 15:26:58 +0530 от Vivek Gautam <gautam.vivek@samsung.com>:
> Using devm_ioremap_resource() API should actually be preferred over
> devm_ioremap(), since the former request the mem region first and then
> gives back the ioremap'ed memory pointer.
> devm_ioremap_resource() calls request_mem_region(), therby preventing
> other drivers to make any overlapping call to the same region.
>
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
> drivers/usb/host/ehci-exynos.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
> index 7f425ac..bccb6f1 100644
> --- a/drivers/usb/host/ehci-exynos.c
> +++ b/drivers/usb/host/ehci-exynos.c
> @@ -135,9 +135,8 @@ skip_phy:
>
> hcd->rsrc_start = res->start;
> hcd->rsrc_len = resource_size(res);
> - hcd->regs = devm_ioremap(&pdev->dev, res->start, hcd->rsrc_len);
> + hcd->regs = devm_ioremap_resource(&pdev->dev, res);
> if (!hcd->regs) {
> - dev_err(&pdev->dev, "Failed to remap I/O memory\n");
> err = -ENOMEM;
> goto fail_io;
> }
You should check this as:
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
...
Same in other patches in this series.
---
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/6] usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 9:56 [PATCH 0/6] usb: host: Cleanup for ioremap'ing hcd memory Vivek Gautam
2014-05-10 9:56 ` [PATCH 1/6] usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap Vivek Gautam
@ 2014-05-10 9:56 ` Vivek Gautam
2014-05-10 9:57 ` [PATCH 3/6] usb: host: ehci-mv: " Vivek Gautam
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:56 UTC (permalink / raw)
To: linux-usb
Cc: linux-samsung-soc, linux-tegra, linux-kernel, linux-arm-kernel,
gregkh, stern, swarren, kgene.kim, thierry.reding, Vivek Gautam
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
drivers/usb/host/ehci-msm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index f341651..99989aa 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -96,9 +96,8 @@ static int ehci_msm_probe(struct platform_device *pdev)
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
- hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
+ hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (!hcd->regs) {
- dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto put_hcd;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 3/6] usb: host: ehci-mv: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 9:56 [PATCH 0/6] usb: host: Cleanup for ioremap'ing hcd memory Vivek Gautam
2014-05-10 9:56 ` [PATCH 1/6] usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap Vivek Gautam
2014-05-10 9:56 ` [PATCH 2/6] usb: host: ehci-msm: " Vivek Gautam
@ 2014-05-10 9:57 ` Vivek Gautam
2014-05-10 9:57 ` [PATCH 4/6] usb: host: ehci-spear: " Vivek Gautam
[not found] ` <1399715823-19839-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
4 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-usb
Cc: linux-samsung-soc, linux-tegra, linux-kernel, linux-arm-kernel,
gregkh, stern, swarren, kgene.kim, thierry.reding, Vivek Gautam
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
drivers/usb/host/ehci-mv.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index bd61612..5d03787 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -176,10 +176,8 @@ static int mv_ehci_probe(struct platform_device *pdev)
goto err_put_hcd;
}
- ehci_mv->phy_regs = devm_ioremap(&pdev->dev, r->start,
- resource_size(r));
+ ehci_mv->phy_regs = devm_ioremap_resource(&pdev->dev, r);
if (!ehci_mv->phy_regs) {
- dev_err(&pdev->dev, "failed to map phy I/O memory\n");
retval = -EFAULT;
goto err_put_hcd;
}
@@ -191,10 +189,8 @@ static int mv_ehci_probe(struct platform_device *pdev)
goto err_put_hcd;
}
- ehci_mv->cap_regs = devm_ioremap(&pdev->dev, r->start,
- resource_size(r));
+ ehci_mv->cap_regs = devm_ioremap_resource(&pdev->dev, r);
if (ehci_mv->cap_regs == NULL) {
- dev_err(&pdev->dev, "failed to map I/O memory\n");
retval = -EFAULT;
goto err_put_hcd;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 4/6] usb: host: ehci-spear: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 9:56 [PATCH 0/6] usb: host: Cleanup for ioremap'ing hcd memory Vivek Gautam
` (2 preceding siblings ...)
2014-05-10 9:57 ` [PATCH 3/6] usb: host: ehci-mv: " Vivek Gautam
@ 2014-05-10 9:57 ` Vivek Gautam
[not found] ` <1399715823-19839-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
4 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-usb
Cc: linux-samsung-soc, linux-tegra, linux-kernel, linux-arm-kernel,
gregkh, stern, swarren, kgene.kim, thierry.reding, Vivek Gautam
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
drivers/usb/host/ehci-spear.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
index 8bd915b..6d84cf2 100644
--- a/drivers/usb/host/ehci-spear.c
+++ b/drivers/usb/host/ehci-spear.c
@@ -106,15 +106,8 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
- if (!devm_request_mem_region(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len,
- driver->description)) {
- retval = -EBUSY;
- goto err_put_hcd;
- }
-
- hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
+ hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (hcd->regs == NULL) {
- dev_dbg(&pdev->dev, "error mapping memory\n");
retval = -ENOMEM;
goto err_put_hcd;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread[parent not found: <1399715823-19839-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>]
* [PATCH 5/6] usb: host: ehci-tegra: Use devm_ioremap_resource instead of devm_ioremap
[not found] ` <1399715823-19839-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2014-05-10 9:57 ` Vivek Gautam
2014-05-10 19:43 ` Sergei Shtylyov
2014-05-10 9:57 ` [PATCH 6/6] usb: host: ohci-exynos: " Vivek Gautam
1 sibling, 1 reply; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-usb-u79uwXL29TY76Z2rM5mHXA
Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
swarren-3lzwWm7+Weoh9ZMKESR00Q, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w, Vivek Gautam
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Signed-off-by: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
drivers/usb/host/ehci-tegra.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 572634c..ccc6433 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -411,9 +411,8 @@ static int tegra_ehci_probe(struct platform_device *pdev)
}
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
- hcd->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
+ hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (!hcd->regs) {
- dev_err(&pdev->dev, "Failed to remap I/O memory\n");
err = -ENOMEM;
goto cleanup_clk_en;
}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 5/6] usb: host: ehci-tegra: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 9:57 ` [PATCH 5/6] usb: host: ehci-tegra: " Vivek Gautam
@ 2014-05-10 19:43 ` Sergei Shtylyov
[not found] ` <536E814E.4020805-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Sergei Shtylyov @ 2014-05-10 19:43 UTC (permalink / raw)
To: Vivek Gautam, linux-usb
Cc: linux-samsung-soc, linux-tegra, linux-kernel, linux-arm-kernel,
gregkh, stern, swarren, kgene.kim, thierry.reding
Hello.
On 05/10/2014 01:57 PM, Vivek Gautam wrote:
> Using devm_ioremap_resource() API should actually be preferred over
> devm_ioremap(), since the former request the mem region first and then
> gives back the ioremap'ed memory pointer.
> devm_ioremap_resource() calls request_mem_region(), therby preventing
> other drivers to make any overlapping call to the same region.
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
> drivers/usb/host/ehci-tegra.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
> index 572634c..ccc6433 100644
> --- a/drivers/usb/host/ehci-tegra.c
> +++ b/drivers/usb/host/ehci-tegra.c
> @@ -411,9 +411,8 @@ static int tegra_ehci_probe(struct platform_device *pdev)
> }
> hcd->rsrc_start = res->start;
> hcd->rsrc_len = resource_size(res);
> - hcd->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> + hcd->regs = devm_ioremap_resource(&pdev->dev, res);
> if (!hcd->regs) {
This has to be changed as well as devm_ioremap_resource() returns error,
not NULL.
> - dev_err(&pdev->dev, "Failed to remap I/O memory\n");
> err = -ENOMEM;
This needs to be changed as well, to pass up the error code
devm_ioremap_resource() returned.
WBR, Sergei
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 6/6] usb: host: ohci-exynos: Use devm_ioremap_resource instead of devm_ioremap
[not found] ` <1399715823-19839-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-05-10 9:57 ` [PATCH 5/6] usb: host: ehci-tegra: " Vivek Gautam
@ 2014-05-10 9:57 ` Vivek Gautam
1 sibling, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-usb-u79uwXL29TY76Z2rM5mHXA
Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
swarren-3lzwWm7+Weoh9ZMKESR00Q, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w, Vivek Gautam
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Signed-off-by: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
drivers/usb/host/ohci-exynos.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 9cf80cb..aa64fb5 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -120,9 +120,8 @@ skip_phy:
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
- hcd->regs = devm_ioremap(&pdev->dev, res->start, hcd->rsrc_len);
+ hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (!hcd->regs) {
- dev_err(&pdev->dev, "Failed to remap I/O memory\n");
err = -ENOMEM;
goto fail_io;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread