提交 18c2bb1b 编写于 作者: R Roger Quadros 提交者: Greg Kroah-Hartman

USB: ehci-omap: Use devm_ioremap_resource()

Make use of devm_ioremap_resource() and correct comment.
Signed-off-by: NRoger Quadros <rogerq@ti.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 54a41966
...@@ -216,23 +216,15 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) ...@@ -216,23 +216,15 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, res = platform_get_resource_byname(pdev,
IORESOURCE_MEM, "ehci"); IORESOURCE_MEM, "ehci");
if (!res) { regs = devm_ioremap_resource(dev, res);
dev_err(dev, "UHH EHCI get resource failed\n"); if (IS_ERR(regs))
return -ENODEV; return PTR_ERR(regs);
}
regs = ioremap(res->start, resource_size(res));
if (!regs) {
dev_err(dev, "UHH EHCI ioremap failed\n");
return -ENOMEM;
}
hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, hcd = usb_create_hcd(&ehci_omap_hc_driver, dev,
dev_name(dev)); dev_name(dev));
if (!hcd) { if (!hcd) {
dev_err(dev, "failed to create hcd with err %d\n", ret); dev_err(dev, "Failed to create HCD\n");
ret = -ENOMEM; return -ENOMEM;
goto err_io;
} }
hcd->rsrc_start = res->start; hcd->rsrc_start = res->start;
...@@ -285,8 +277,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) ...@@ -285,8 +277,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
usb_put_hcd(hcd); usb_put_hcd(hcd);
err_io:
iounmap(regs);
return ret; return ret;
} }
...@@ -306,7 +296,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) ...@@ -306,7 +296,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
disable_put_regulator(dev->platform_data); disable_put_regulator(dev->platform_data);
iounmap(hcd->regs);
usb_put_hcd(hcd); usb_put_hcd(hcd);
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册