* [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
` (4 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:56 UTC (permalink / raw)
To: linux-arm-kernel
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
2014-05-10 11:39 ` Vivek Gautam
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Shiyan @ 2014-05-10 10:06 UTC (permalink / raw)
To: linux-arm-kernel
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 1/6] usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 10:06 ` Alexander Shiyan
@ 2014-05-10 11:39 ` Vivek Gautam
0 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 11:39 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Sat, May 10, 2014 at 3:36 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
> 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);
> ...
Thanks for pointing out. Will change this.
>
> Same in other patches in this series.
>
> ---
>
--
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India
^ 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
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:56 UTC (permalink / raw)
To: linux-arm-kernel
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
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-arm-kernel
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
2014-05-10 9:57 ` [PATCH 5/6] usb: host: ehci-tegra: " Vivek Gautam
2014-05-10 9:57 ` [PATCH 6/6] usb: host: ohci-exynos: " Vivek Gautam
5 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-arm-kernel
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* [PATCH 5/6] usb: host: ehci-tegra: 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
` (3 preceding siblings ...)
2014-05-10 9:57 ` [PATCH 4/6] usb: host: ehci-spear: " Vivek Gautam
@ 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
5 siblings, 1 reply; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-arm-kernel
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) {
- dev_err(&pdev->dev, "Failed to remap I/O memory\n");
err = -ENOMEM;
goto cleanup_clk_en;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* [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
2014-05-11 14:44 ` Vivek Gautam
0 siblings, 1 reply; 11+ messages in thread
From: Sergei Shtylyov @ 2014-05-10 19:43 UTC (permalink / raw)
To: linux-arm-kernel
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 5/6] usb: host: ehci-tegra: Use devm_ioremap_resource instead of devm_ioremap
2014-05-10 19:43 ` Sergei Shtylyov
@ 2014-05-11 14:44 ` Vivek Gautam
0 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-11 14:44 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Sun, May 11, 2014 at 1:13 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> 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.
Have already updated in the v2 version of this patch, and others in the series.
>
>
>> - 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.
ditoo
--
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 6/6] usb: host: ohci-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
` (4 preceding siblings ...)
2014-05-10 9:57 ` [PATCH 5/6] usb: host: ehci-tegra: " Vivek Gautam
@ 2014-05-10 9:57 ` Vivek Gautam
5 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2014-05-10 9:57 UTC (permalink / raw)
To: linux-arm-kernel
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/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