aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-12-11 02:20:35 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-18 19:35:11 -0500
commit849da2dce5277107327adc5692170512e7cb8064 (patch)
tree355ff35d08d1f0597161c38ed0572af246a15421 /drivers/usb/host
parent644db16636555b30611b612d5059914147e07042 (diff)
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')
-rw-r--r--drivers/usb/host/ehci-w90x900.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
index 12c1a563c3f2..a9303aff125e 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,
58 hcd->rsrc_start = res->start; 58 hcd->rsrc_start = res->start;
59 hcd->rsrc_len = resource_size(res); 59 hcd->rsrc_len = resource_size(res);
60 60
61 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { 61 hcd->regs = devm_ioremap_resource(&pdev->dev, res);
62 retval = -EBUSY; 62 if (IS_ERR(hcd->regs)) {
63 retval = PTR_ERR(hcd->regs);
63 goto err2; 64 goto err2;
64 } 65 }
65 66
66 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
67 if (hcd->regs == NULL) {
68 retval = -EFAULT;
69 goto err3;
70 }
71
72 ehci = hcd_to_ehci(hcd); 67 ehci = hcd_to_ehci(hcd);
73 ehci->caps = hcd->regs; 68 ehci->caps = hcd->regs;
74 ehci->regs = hcd->regs + 69 ehci->regs = hcd->regs +
@@ -88,18 +83,14 @@ static int usb_w90x900_probe(const struct hc_driver *driver,
88 83
89 irq = platform_get_irq(pdev, 0); 84 irq = platform_get_irq(pdev, 0);
90 if (irq < 0) 85 if (irq < 0)
91 goto err4; 86 goto err2;
92 87
93 retval = usb_add_hcd(hcd, irq, IRQF_SHARED); 88 retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
94 if (retval != 0) 89 if (retval != 0)
95 goto err4; 90 goto err2;
96 91
97 device_wakeup_enable(hcd->self.controller); 92 device_wakeup_enable(hcd->self.controller);
98 return retval; 93 return retval;
99err4:
100 iounmap(hcd->regs);
101err3:
102 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
103err2: 94err2:
104 usb_put_hcd(hcd); 95 usb_put_hcd(hcd);
105err1: 96err1:
@@ -110,8 +101,6 @@ static void usb_w90x900_remove(struct usb_hcd *hcd,
110 struct platform_device *pdev) 101 struct platform_device *pdev)
111{ 102{
112 usb_remove_hcd(hcd); 103 usb_remove_hcd(hcd);
113 iounmap(hcd->regs);
114 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
115 usb_put_hcd(hcd); 104 usb_put_hcd(hcd);
116} 105}
117 106