From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Vivek Gautam <gautam.vivek@samsung.com>, linux-usb@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org,
stern@rowland.harvard.edu, swarren@wwwdotorg.org,
kgene.kim@samsung.com, thierry.reding@gmail.com
Subject: Re: [PATCH 5/6] usb: host: ehci-tegra: Use devm_ioremap_resource instead of devm_ioremap
Date: Sat, 10 May 2014 23:43:10 +0400 [thread overview]
Message-ID: <536E814E.4020805@cogentembedded.com> (raw)
In-Reply-To: <1399715823-19839-6-git-send-email-gautam.vivek@samsung.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: sergei.shtylyov@cogentembedded.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] usb: host: ehci-tegra: Use devm_ioremap_resource instead of devm_ioremap
Date: Sat, 10 May 2014 23:43:10 +0400 [thread overview]
Message-ID: <536E814E.4020805@cogentembedded.com> (raw)
In-Reply-To: <1399715823-19839-6-git-send-email-gautam.vivek@samsung.com>
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
next prev parent reply other threads:[~2014-05-10 19:42 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
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 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 10:06 ` Alexander Shiyan
2014-05-10 10:06 ` Alexander Shiyan
2014-05-10 10:06 ` Alexander Shiyan
[not found] ` <1399716396.580639659-iE7NquU0hAtsdVUOrk1QfQ@public.gmane.org>
2014-05-10 11:39 ` Vivek Gautam
2014-05-10 11:39 ` Vivek Gautam
2014-05-10 11:39 ` Vivek Gautam
2014-05-10 9:56 ` [PATCH 2/6] usb: host: ehci-msm: " Vivek Gautam
2014-05-10 9:56 ` Vivek Gautam
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 4/6] usb: host: ehci-spear: " Vivek Gautam
2014-05-10 9:57 ` Vivek Gautam
[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
2014-05-10 9:57 ` Vivek Gautam
2014-05-10 19:43 ` Sergei Shtylyov [this message]
2014-05-10 19:43 ` Sergei Shtylyov
[not found] ` <536E814E.4020805-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-05-11 14:44 ` Vivek Gautam
2014-05-11 14:44 ` Vivek Gautam
2014-05-11 14:44 ` Vivek Gautam
2014-05-10 9:57 ` [PATCH 6/6] usb: host: ohci-exynos: " Vivek Gautam
2014-05-10 9:57 ` Vivek Gautam
2014-05-10 9:57 ` Vivek Gautam
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=536E814E.4020805@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=gautam.vivek@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.