USB: ohci-spear: Use devm_ioremap_resource()
authorJingoo Han <jg1.han@samsung.com>
Wed, 11 Dec 2013 07:29:15 +0000 (16:29 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Dec 2013 00:36:11 +0000 (16:36 -0800)
Use devm_ioremap_resource() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-spear.c

index 4cb98abc0bef79e98e5a8051af8788c4e6a33f8e..8b29a0c04c23b9958e9e21b91d73d8f35c944c8e 100644 (file)
@@ -81,17 +81,10 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
 
        hcd->rsrc_start = pdev->resource[0].start;
        hcd->rsrc_len = resource_size(res);
-       if (!devm_request_mem_region(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len,
-                               hcd_name)) {
-               dev_dbg(&pdev->dev, "request_mem_region failed\n");
-               retval = -EBUSY;
-               goto err_put_hcd;
-       }
 
-       hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
-       if (!hcd->regs) {
-               dev_dbg(&pdev->dev, "ioremap failed\n");
-               retval = -ENOMEM;
+       hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(hcd->regs)) {
+               retval = PTR_ERR(hcd->regs);
                goto err_put_hcd;
        }