[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1363085090-24676-3-git-send-email-rogerq@ti.com>
Date: Tue, 12 Mar 2013 12:44:40 +0200
From: Roger Quadros <rogerq@...com>
To: <gregkh@...uxfoundation.org>
CC: <stern@...land.harvard.edu>, <balbi@...com>, <b-cousson@...com>,
<mark.rutland@....com>, <linux-kernel@...r.kernel.org>,
<linux-usb@...r.kernel.org>, <linux-omap@...r.kernel.org>,
<devicetree-discuss@...ts.ozlabs.org>, <rogerq@...com>
Subject: [PATCH 02/12] USB: ehci-omap: Use devm_ioremap_resource()
Make use of devm_ioremap_resource() and correct comment.
Signed-off-by: Roger Quadros <rogerq@...com>
Acked-by: Alan Stern <stern@...land.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists