diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-12-11 07:20:35 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-19 00:35:11 (GMT) |
commit | 849da2dce5277107327adc5692170512e7cb8064 (patch) | |
tree | 355ff35d08d1f0597161c38ed0572af246a15421 /drivers/usb/host/ehci-w90x900.c | |
parent | 644db16636555b30611b612d5059914147e07042 (diff) | |
download | linux-849da2dce5277107327adc5692170512e7cb8064.tar.xz |
USB: ehci-w90x900: Use devm_ioremap_resource()
Use devm_ioremap_resource() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-w90x900.c')
-rw-r--r-- | drivers/usb/host/ehci-w90x900.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c index 12c1a56..a9303af 100644 --- a/drivers/usb/host/ehci-w90x900.c +++ b/drivers/usb/host/ehci-w90x900.c @@ -58,17 +58,12 @@ static int usb_w90x900_probe(const struct hc_driver *driver, hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); - if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { - retval = -EBUSY; + hcd->regs = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(hcd->regs)) { + retval = PTR_ERR(hcd->regs); goto err2; } - hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); - if (hcd->regs == NULL) { - retval = -EFAULT; - goto err3; - } - ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; ehci->regs = hcd->regs + @@ -88,18 +83,14 @@ static int usb_w90x900_probe(const struct hc_driver *driver, irq = platform_get_irq(pdev, 0); if (irq < 0) - goto err4; + goto err2; retval = usb_add_hcd(hcd, irq, IRQF_SHARED); if (retval != 0) - goto err4; + goto err2; device_wakeup_enable(hcd->self.controller); return retval; -err4: - iounmap(hcd->regs); -err3: - release_mem_region(hcd->rsrc_start, hcd->rsrc_len); err2: usb_put_hcd(hcd); err1: @@ -110,8 +101,6 @@ static void usb_w90x900_remove(struct usb_hcd *hcd, struct platform_device *pdev) { usb_remove_hcd(hcd); - iounmap(hcd->regs); - release_mem_region(hcd->rsrc_start, hcd->rsrc_len); usb_put_hcd(hcd); } |