devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: gregkh@linuxfoundation.org
Cc: stern@rowland.harvard.edu, balbi@ti.com, b-cousson@ti.com,
	mark.rutland@arm.com, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, rogerq@ti.com
Subject: [PATCH 02/12] USB: ehci-omap: Use devm_ioremap_resource()
Date: Tue, 12 Mar 2013 12:44:40 +0200	[thread overview]
Message-ID: <1363085090-24676-3-git-send-email-rogerq@ti.com> (raw)
In-Reply-To: <1363085090-24676-1-git-send-email-rogerq@ti.com>

Make use of devm_ioremap_resource() and correct comment.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
 drivers/usb/host/ehci-omap.c |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index fa66757..70e8e6f 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -216,23 +216,15 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 
 	res =  platform_get_resource_byname(pdev,
 				IORESOURCE_MEM, "ehci");
-	if (!res) {
-		dev_err(dev, "UHH EHCI get resource failed\n");
-		return -ENODEV;
-	}
-
-	regs = ioremap(res->start, resource_size(res));
-	if (!regs) {
-		dev_err(dev, "UHH EHCI ioremap failed\n");
-		return -ENOMEM;
-	}
+	regs = devm_ioremap_resource(dev, res);
+	if (IS_ERR(regs))
+		return PTR_ERR(regs);
 
 	hcd = usb_create_hcd(&ehci_omap_hc_driver, dev,
 			dev_name(dev));
 	if (!hcd) {
-		dev_err(dev, "failed to create hcd with err %d\n", ret);
-		ret = -ENOMEM;
-		goto err_io;
+		dev_err(dev, "Failed to create HCD\n");
+		return -ENOMEM;
 	}
 
 	hcd->rsrc_start = res->start;
@@ -285,8 +277,6 @@ err_pm_runtime:
 	pm_runtime_put_sync(dev);
 	usb_put_hcd(hcd);
 
-err_io:
-	iounmap(regs);
 	return ret;
 }
 
@@ -306,7 +296,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
 
 	usb_remove_hcd(hcd);
 	disable_put_regulator(dev->platform_data);
-	iounmap(hcd->regs);
 	usb_put_hcd(hcd);
 
 	pm_runtime_put_sync(dev);
-- 
1.7.4.1

  reply	other threads:[~2013-03-12 10:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 10:44 [PATCH 00/12] USB: ehci-omap: Device tree support for 3.10 Roger Quadros
2013-03-12 10:44 ` Roger Quadros [this message]
2013-03-12 10:44 ` [PATCH 05/12] USB: ehci-omap: Remove PHY regulator handling code Roger Quadros
     [not found] ` <1363085090-24676-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-03-12 10:44   ` [PATCH 01/12] USB: EHCI: split ehci-omap out to a separate driver Roger Quadros
2013-03-12 10:44   ` [PATCH 03/12] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend Roger Quadros
2013-03-12 10:44   ` [PATCH 04/12] USB: ehci-omap: Remove PHY reset handling code Roger Quadros
2013-03-12 10:44   ` [PATCH 06/12] USB: ehci-omap: Select NOP USB transceiver driver Roger Quadros
2013-03-12 10:44   ` [PATCH 07/12] USB: ehci-omap: Get platform resources by index rather than by name Roger Quadros
2013-03-12 10:44   ` [PATCH 08/12] USB: ohci-omap3: " Roger Quadros
2013-03-12 10:44 ` [PATCH 09/12] USB: ohci-omap3: Add device tree support and binding information Roger Quadros
2013-03-12 10:44 ` [PATCH 10/12] USB: ehci-omap: " Roger Quadros
2013-03-12 10:44 ` [PATCH 11/12] USB: ehci-omap: Try to get PHY even if not in PHY mode Roger Quadros
2013-03-12 15:57   ` Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.1303121155540.2153-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-03-14 14:08       ` Felipe Balbi
2013-03-14 15:08         ` Alan Stern
2013-03-12 10:44 ` [PATCH 12/12] USB: ehci-omap: Fix detection in HSIC mode Roger Quadros
     [not found]   ` <1363085090-24676-13-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-03-12 10:51     ` kishon
     [not found]       ` <513F089B.5080004-l0cyMroinI0@public.gmane.org>
2013-03-12 10:53         ` Roger Quadros
2013-03-12 11:09     ` [PATCH v2 " Roger Quadros
2013-03-12 16:07       ` Alan Stern
     [not found]         ` <Pine.LNX.4.44L0.1303121201050.2153-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-03-13 11:48           ` Roger Quadros

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=1363085090-24676-3-git-send-email-rogerq@ti.com \
    --to=rogerq@ti.com \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --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;
as well as URLs for NNTP newsgroup(s).