Skip to content

Commit

Permalink
USB: ehci-omap: Use devm_ioremap_resource()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roger Quadros authored and Greg Kroah-Hartman committed Mar 15, 2013
1 parent 54a4196 commit 18c2bb1
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions drivers/usb/host/ehci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -285,8 +277,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
pm_runtime_put_sync(dev);
usb_put_hcd(hcd);

err_io:
iounmap(regs);
return ret;
}

Expand All @@ -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);
Expand Down

0 comments on commit 18c2bb1

Please sign in to comment.