aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-octeon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-octeon.c')
-rw-r--r--drivers/usb/host/ehci-octeon.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c
index 4c528b2c033a..9051439039a7 100644
--- a/drivers/usb/host/ehci-octeon.c
+++ b/drivers/usb/host/ehci-octeon.c
@@ -128,20 +128,12 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev)
128 hcd->rsrc_start = res_mem->start; 128 hcd->rsrc_start = res_mem->start;
129 hcd->rsrc_len = resource_size(res_mem); 129 hcd->rsrc_len = resource_size(res_mem);
130 130
131 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, 131 hcd->regs = devm_ioremap_resource(&pdev->dev, res_mem);
132 OCTEON_EHCI_HCD_NAME)) { 132 if (IS_ERR(hcd->regs)) {
133 dev_err(&pdev->dev, "request_mem_region failed\n"); 133 ret = PTR_ERR(hcd->regs);
134 ret = -EBUSY;
135 goto err1; 134 goto err1;
136 } 135 }
137 136
138 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
139 if (!hcd->regs) {
140 dev_err(&pdev->dev, "ioremap failed\n");
141 ret = -ENOMEM;
142 goto err2;
143 }
144
145 ehci_octeon_start(); 137 ehci_octeon_start();
146 138
147 ehci = hcd_to_ehci(hcd); 139 ehci = hcd_to_ehci(hcd);
@@ -156,18 +148,16 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev)
156 ret = usb_add_hcd(hcd, irq, IRQF_SHARED); 148 ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
157 if (ret) { 149 if (ret) {
158 dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret); 150 dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret);
159 goto err3; 151 goto err2;
160 } 152 }
153 device_wakeup_enable(hcd->self.controller);
161 154
162 platform_set_drvdata(pdev, hcd); 155 platform_set_drvdata(pdev, hcd);
163 156
164 return 0; 157 return 0;
165err3: 158err2:
166 ehci_octeon_stop(); 159 ehci_octeon_stop();
167 160
168 iounmap(hcd->regs);
169err2:
170 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
171err1: 161err1:
172 usb_put_hcd(hcd); 162 usb_put_hcd(hcd);
173 return ret; 163 return ret;
@@ -180,8 +170,6 @@ static int ehci_octeon_drv_remove(struct platform_device *pdev)
180 usb_remove_hcd(hcd); 170 usb_remove_hcd(hcd);
181 171
182 ehci_octeon_stop(); 172 ehci_octeon_stop();
183 iounmap(hcd->regs);
184 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
185 usb_put_hcd(hcd); 173 usb_put_hcd(hcd);
186 174
187 return 0; 175 return 0;