mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivek Gautam <gautam.vivek@samsung.com>
To: "Ivan T. Ivanov" <ivan.ivanov@linaro.org>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
Date: Tue, 21 Apr 2015 16:46:03 +0530	[thread overview]
Message-ID: <5C67DC9B092C4B1AAF6698027419ED92@sisodomain.com> (raw)
In-Reply-To: <1429600263-4366-1-git-send-email-ivan.ivanov@linaro.org>

Hi,

On Tuesday, April 21, 2015 12:41 PM "Ivan T. Ivanov"
<ivan.ivanov@linaro.org> wrote:
> This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> devm_ioremap_resource instead of devm_ioremap"), 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>

Since ehci-msm and msm_otg both want to control few USB registers,
it makes sense to request ioremap'ed region in both drivers.

Acked-by: Vivek Gautam <gautam.vivek@samsung.com>

I can see a patch in mailing list for adding both ehci-host and otg on msm 
[1].
But I think it has not yet made it to mainline kernel.

[1] [v3,04/11] ARM: dts: apq8064: Add USB OTG support
https://patches.linaro.org/47067/

> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> ---
> 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
> 

  reply	other threads:[~2015-04-21 11:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21  7:11 Ivan T. Ivanov
2015-04-21 11:16 ` Vivek Gautam [this message]
2015-04-21 11:18   ` Ivan T. Ivanov
2015-04-21 15:04 ` Alan Stern
2015-04-21 15:57   ` Ivan T. Ivanov
2015-04-21 16:56     ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5C67DC9B092C4B1AAF6698027419ED92@sisodomain.com \
    --to=gautam.vivek@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ivan.ivanov@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®