diff options
author | Roger Quadros <rogerq@ti.com> | 2013-03-12 06:44:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-15 14:51:46 -0400 |
commit | 18c2bb1b8c1571f4c1fa33cc1f4525b282059455 (patch) | |
tree | da5568f432c2f7eb4897bab76ab1dd718d7ba569 /drivers/usb/host/ehci-omap.c | |
parent | 54a419668b0f27b7982807fb2376d237e0a0ce05 (diff) |
USB: ehci-omap: Use devm_ioremap_resource()
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-omap.c')
-rw-r--r-- | 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 fa667577d9b9..70e8e6f33d42 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) | |||
216 | 216 | ||
217 | res = platform_get_resource_byname(pdev, | 217 | res = platform_get_resource_byname(pdev, |
218 | IORESOURCE_MEM, "ehci"); | 218 | IORESOURCE_MEM, "ehci"); |
219 | if (!res) { | 219 | regs = devm_ioremap_resource(dev, res); |
220 | dev_err(dev, "UHH EHCI get resource failed\n"); | 220 | if (IS_ERR(regs)) |
221 | return -ENODEV; | 221 | return PTR_ERR(regs); |
222 | } | ||
223 | |||
224 | regs = ioremap(res->start, resource_size(res)); | ||
225 | if (!regs) { | ||
226 | dev_err(dev, "UHH EHCI ioremap failed\n"); | ||
227 | return -ENOMEM; | ||
228 | } | ||
229 | 222 | ||
230 | hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, | 223 | hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, |
231 | dev_name(dev)); | 224 | dev_name(dev)); |
232 | if (!hcd) { | 225 | if (!hcd) { |
233 | dev_err(dev, "failed to create hcd with err %d\n", ret); | 226 | dev_err(dev, "Failed to create HCD\n"); |
234 | ret = -ENOMEM; | 227 | return -ENOMEM; |
235 | goto err_io; | ||
236 | } | 228 | } |
237 | 229 | ||
238 | hcd->rsrc_start = res->start; | 230 | hcd->rsrc_start = res->start; |
@@ -285,8 +277,6 @@ err_pm_runtime: | |||
285 | pm_runtime_put_sync(dev); | 277 | pm_runtime_put_sync(dev); |
286 | usb_put_hcd(hcd); | 278 | usb_put_hcd(hcd); |
287 | 279 | ||
288 | err_io: | ||
289 | iounmap(regs); | ||
290 | return ret; | 280 | return ret; |
291 | } | 281 | } |
292 | 282 | ||
@@ -306,7 +296,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
306 | 296 | ||
307 | usb_remove_hcd(hcd); | 297 | usb_remove_hcd(hcd); |
308 | disable_put_regulator(dev->platform_data); | 298 | disable_put_regulator(dev->platform_data); |
309 | iounmap(hcd->regs); | ||
310 | usb_put_hcd(hcd); | 299 | usb_put_hcd(hcd); |
311 | 300 | ||
312 | pm_runtime_put_sync(dev); | 301 | pm_runtime_put_sync(dev); |