aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ohci-platform.c')
-rw-r--r--drivers/usb/host/ohci-platform.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index 1344426b05a..bda4e0bb8ab 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -127,29 +127,19 @@ static int __devinit ohci_platform_probe(struct platform_device *dev)
127 hcd->rsrc_start = res_mem->start; 127 hcd->rsrc_start = res_mem->start;
128 hcd->rsrc_len = resource_size(res_mem); 128 hcd->rsrc_len = resource_size(res_mem);
129 129
130 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { 130 hcd->regs = devm_request_and_ioremap(&dev->dev, res_mem);
131 dev_err(&dev->dev, "controller already in use");
132 err = -EBUSY;
133 goto err_put_hcd;
134 }
135
136 hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
137 if (!hcd->regs) { 131 if (!hcd->regs) {
138 err = -ENOMEM; 132 err = -ENOMEM;
139 goto err_release_region; 133 goto err_put_hcd;
140 } 134 }
141 err = usb_add_hcd(hcd, irq, IRQF_SHARED); 135 err = usb_add_hcd(hcd, irq, IRQF_SHARED);
142 if (err) 136 if (err)
143 goto err_iounmap; 137 goto err_put_hcd;
144 138
145 platform_set_drvdata(dev, hcd); 139 platform_set_drvdata(dev, hcd);
146 140
147 return err; 141 return err;
148 142
149err_iounmap:
150 iounmap(hcd->regs);
151err_release_region:
152 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
153err_put_hcd: 143err_put_hcd:
154 usb_put_hcd(hcd); 144 usb_put_hcd(hcd);
155err_power: 145err_power:
@@ -165,8 +155,6 @@ static int __devexit ohci_platform_remove(struct platform_device *dev)
165 struct usb_ohci_pdata *pdata = dev->dev.platform_data; 155 struct usb_ohci_pdata *pdata = dev->dev.platform_data;
166 156
167 usb_remove_hcd(hcd); 157 usb_remove_hcd(hcd);
168 iounmap(hcd->regs);
169 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
170 usb_put_hcd(hcd); 158 usb_put_hcd(hcd);
171 platform_set_drvdata(dev, NULL); 159 platform_set_drvdata(dev, NULL);
172 160