* [PATCH v2] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
@ 2015-04-27 12:27 Ivan T. Ivanov
2015-04-27 14:44 ` Alan Stern
0 siblings, 1 reply; 3+ messages in thread
From: Ivan T. Ivanov @ 2015-04-27 12:27 UTC (permalink / raw)
To: Alan Stern
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm, Vivek Gautam
This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
devm_ioremap_resource instead of devm_ioremap") and commit
e507bf577e5a ("host: ehci-msm: remove duplicate check on resource"),
because msm_otg and this driver are using same address space to
access AHB mode and USB command registers.
Cc: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
Changes since v0:
* Add note to patch description that also commit e507bf577e5a is reverted.
drivers/usb/host/ehci-msm.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 9db74ca..275c92e 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -88,13 +88,20 @@ static int ehci_msm_probe(struct platform_device *pdev)
}
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);
+ 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(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
+ if (!hcd->regs) {
+ dev_err(&pdev->dev, "ioremap failed\n");
+ ret = -ENOMEM;
+ goto put_hcd;
+ }
/*
* OTG driver takes care of PHY initialization, clock management,
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
2015-04-27 12:27 [PATCH v2] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap" Ivan T. Ivanov
@ 2015-04-27 14:44 ` Alan Stern
2015-04-28 7:30 ` Vivek Gautam
0 siblings, 1 reply; 3+ messages in thread
From: Alan Stern @ 2015-04-27 14:44 UTC (permalink / raw)
To: Ivan T. Ivanov
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm, Vivek Gautam
On Mon, 27 Apr 2015, Ivan T. Ivanov wrote:
> This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> devm_ioremap_resource instead of devm_ioremap") and commit
> e507bf577e5a ("host: ehci-msm: remove duplicate check on resource"),
> because msm_otg and this driver are using same address space to
> access AHB mode and USB command registers.
>
> Cc: Vivek Gautam <gautam.vivek@samsung.com>
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> ---
>
> Changes since v0:
>
> * Add note to patch description that also commit e507bf577e5a is reverted.
>
> drivers/usb/host/ehci-msm.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
> index 9db74ca..275c92e 100644
> --- a/drivers/usb/host/ehci-msm.c
> +++ b/drivers/usb/host/ehci-msm.c
> @@ -88,13 +88,20 @@ static int ehci_msm_probe(struct platform_device *pdev)
> }
>
> 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);
> + 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(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
> + if (!hcd->regs) {
> + dev_err(&pdev->dev, "ioremap failed\n");
> + ret = -ENOMEM;
> + goto put_hcd;
> + }
>
> /*
> * OTG driver takes care of PHY initialization, clock management,
> --
> 1.9.1
Acked-by: Alan Stern <stern@rowland.harvard.edu>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
2015-04-27 14:44 ` Alan Stern
@ 2015-04-28 7:30 ` Vivek Gautam
0 siblings, 0 replies; 3+ messages in thread
From: Vivek Gautam @ 2015-04-28 7:30 UTC (permalink / raw)
To: Ivan T. Ivanov
Cc: Greg Kroah-Hartman, stern, linux-usb, linux-kernel, linux-arm-msm
Hi,
--------------------------------------------------
From: "Alan Stern" <stern@rowland.harvard.edu>
Sent: Monday, April 27, 2015 8:14 PM
To: "Ivan T. Ivanov" <ivan.ivanov@linaro.org>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>;
<linux-usb@vger.kernel.org>; <linux-kernel@vger.kernel.org>;
<linux-arm-msm@vger.kernel.org>; "Vivek Gautam" <gautam.vivek@samsung.com>
Subject: Re: [PATCH v2] Revert "usb: host: ehci-msm: Use
devm_ioremap_resource instead of devm_ioremap"
> On Mon, 27 Apr 2015, Ivan T. Ivanov wrote:
>
>> This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
>> devm_ioremap_resource instead of devm_ioremap") and commit
>> e507bf577e5a ("host: ehci-msm: remove duplicate check on resource"),
>> because msm_otg and this driver are using same address space to
>> access AHB mode and USB command registers.
>>
>> Cc: Vivek Gautam <gautam.vivek@samsung.com>
>> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
>> ---
>>
>> Changes since v0:
>>
>> * Add note to patch description that also commit e507bf577e5a is
>> reverted.
Ok,
Acked-by: Vivek Gautam <gautam.vivek@samsung.com>
>>
>> drivers/usb/host/ehci-msm.c | 13 ++++++++++---
>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
>> index 9db74ca..275c92e 100644
>> --- a/drivers/usb/host/ehci-msm.c
>> +++ b/drivers/usb/host/ehci-msm.c
>> @@ -88,13 +88,20 @@ static int ehci_msm_probe(struct platform_device
>> *pdev)
>> }
>>
>> 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);
>> + 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(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
>> + if (!hcd->regs) {
>> + dev_err(&pdev->dev, "ioremap failed\n");
>> + ret = -ENOMEM;
>> + goto put_hcd;
>> + }
>>
>> /*
>> * OTG driver takes care of PHY initialization, clock management,
>> --
>> 1.9.1
>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-28 7:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-27 12:27 [PATCH v2] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap" Ivan T. Ivanov
2015-04-27 14:44 ` Alan Stern
2015-04-28 7:30 ` Vivek Gautam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®