diff options
author | Roger Quadros <rogerq@ti.com> | 2013-07-22 08:04:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 15:01:12 -0400 |
commit | aaf6b52d50f85ed792c9c8987f5169f3dce2adea (patch) | |
tree | da173e92e0c85a039510092e31ff915af1331585 /drivers | |
parent | c4b51a431561f0bacc1740aa27f080bf95c4d6c7 (diff) |
USB: host: Use usb_hcd_platform_shutdown() wherever possible
Most HCD drivers are doing the same thing in their ".shutdown" callback
so it makes sense to use the generic usb_hcd_platform_shutdown()
handler there.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-grlib.c | 11 | ||||
-rw-r--r-- | drivers/usb/host/ehci-mxc.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/ehci-ppc-of.c | 11 | ||||
-rw-r--r-- | drivers/usb/host/ehci-s5p.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/ehci-xilinx-of.c | 17 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap3.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/ohci-ppc-of.c | 11 |
8 files changed, 8 insertions, 82 deletions
diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c index a77bd8dc33f4..83ab51af250f 100644 --- a/drivers/usb/host/ehci-grlib.c +++ b/drivers/usb/host/ehci-grlib.c | |||
@@ -167,15 +167,6 @@ static int ehci_hcd_grlib_remove(struct platform_device *op) | |||
167 | } | 167 | } |
168 | 168 | ||
169 | 169 | ||
170 | static void ehci_hcd_grlib_shutdown(struct platform_device *op) | ||
171 | { | ||
172 | struct usb_hcd *hcd = platform_get_drvdata(op); | ||
173 | |||
174 | if (hcd->driver->shutdown) | ||
175 | hcd->driver->shutdown(hcd); | ||
176 | } | ||
177 | |||
178 | |||
179 | static const struct of_device_id ehci_hcd_grlib_of_match[] = { | 170 | static const struct of_device_id ehci_hcd_grlib_of_match[] = { |
180 | { | 171 | { |
181 | .name = "GAISLER_EHCI", | 172 | .name = "GAISLER_EHCI", |
@@ -191,7 +182,7 @@ MODULE_DEVICE_TABLE(of, ehci_hcd_grlib_of_match); | |||
191 | static struct platform_driver ehci_grlib_driver = { | 182 | static struct platform_driver ehci_grlib_driver = { |
192 | .probe = ehci_hcd_grlib_probe, | 183 | .probe = ehci_hcd_grlib_probe, |
193 | .remove = ehci_hcd_grlib_remove, | 184 | .remove = ehci_hcd_grlib_remove, |
194 | .shutdown = ehci_hcd_grlib_shutdown, | 185 | .shutdown = usb_hcd_platform_shutdown, |
195 | .driver = { | 186 | .driver = { |
196 | .name = "grlib-ehci", | 187 | .name = "grlib-ehci", |
197 | .owner = THIS_MODULE, | 188 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index e4c34ac386c0..030b53958845 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -197,20 +197,12 @@ static int ehci_mxc_drv_remove(struct platform_device *pdev) | |||
197 | return 0; | 197 | return 0; |
198 | } | 198 | } |
199 | 199 | ||
200 | static void ehci_mxc_drv_shutdown(struct platform_device *pdev) | ||
201 | { | ||
202 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | ||
203 | |||
204 | if (hcd->driver->shutdown) | ||
205 | hcd->driver->shutdown(hcd); | ||
206 | } | ||
207 | |||
208 | MODULE_ALIAS("platform:mxc-ehci"); | 200 | MODULE_ALIAS("platform:mxc-ehci"); |
209 | 201 | ||
210 | static struct platform_driver ehci_mxc_driver = { | 202 | static struct platform_driver ehci_mxc_driver = { |
211 | .probe = ehci_mxc_drv_probe, | 203 | .probe = ehci_mxc_drv_probe, |
212 | .remove = ehci_mxc_drv_remove, | 204 | .remove = ehci_mxc_drv_remove, |
213 | .shutdown = ehci_mxc_drv_shutdown, | 205 | .shutdown = usb_hcd_platform_shutdown, |
214 | .driver = { | 206 | .driver = { |
215 | .name = "mxc-ehci", | 207 | .name = "mxc-ehci", |
216 | }, | 208 | }, |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 9bd7dfe3315b..4384d07115d1 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -278,14 +278,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
278 | return 0; | 278 | return 0; |
279 | } | 279 | } |
280 | 280 | ||
281 | static void ehci_hcd_omap_shutdown(struct platform_device *pdev) | ||
282 | { | ||
283 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); | ||
284 | |||
285 | if (hcd->driver->shutdown) | ||
286 | hcd->driver->shutdown(hcd); | ||
287 | } | ||
288 | |||
289 | static const struct of_device_id omap_ehci_dt_ids[] = { | 281 | static const struct of_device_id omap_ehci_dt_ids[] = { |
290 | { .compatible = "ti,ehci-omap" }, | 282 | { .compatible = "ti,ehci-omap" }, |
291 | { } | 283 | { } |
@@ -296,7 +288,7 @@ MODULE_DEVICE_TABLE(of, omap_ehci_dt_ids); | |||
296 | static struct platform_driver ehci_hcd_omap_driver = { | 288 | static struct platform_driver ehci_hcd_omap_driver = { |
297 | .probe = ehci_hcd_omap_probe, | 289 | .probe = ehci_hcd_omap_probe, |
298 | .remove = ehci_hcd_omap_remove, | 290 | .remove = ehci_hcd_omap_remove, |
299 | .shutdown = ehci_hcd_omap_shutdown, | 291 | .shutdown = usb_hcd_platform_shutdown, |
300 | /*.suspend = ehci_hcd_omap_suspend, */ | 292 | /*.suspend = ehci_hcd_omap_suspend, */ |
301 | /*.resume = ehci_hcd_omap_resume, */ | 293 | /*.resume = ehci_hcd_omap_resume, */ |
302 | .driver = { | 294 | .driver = { |
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c index 86da09c0f8d0..932293fa32de 100644 --- a/drivers/usb/host/ehci-ppc-of.c +++ b/drivers/usb/host/ehci-ppc-of.c | |||
@@ -215,15 +215,6 @@ static int ehci_hcd_ppc_of_remove(struct platform_device *op) | |||
215 | } | 215 | } |
216 | 216 | ||
217 | 217 | ||
218 | static void ehci_hcd_ppc_of_shutdown(struct platform_device *op) | ||
219 | { | ||
220 | struct usb_hcd *hcd = platform_get_drvdata(op); | ||
221 | |||
222 | if (hcd->driver->shutdown) | ||
223 | hcd->driver->shutdown(hcd); | ||
224 | } | ||
225 | |||
226 | |||
227 | static const struct of_device_id ehci_hcd_ppc_of_match[] = { | 218 | static const struct of_device_id ehci_hcd_ppc_of_match[] = { |
228 | { | 219 | { |
229 | .compatible = "usb-ehci", | 220 | .compatible = "usb-ehci", |
@@ -236,7 +227,7 @@ MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match); | |||
236 | static struct platform_driver ehci_hcd_ppc_of_driver = { | 227 | static struct platform_driver ehci_hcd_ppc_of_driver = { |
237 | .probe = ehci_hcd_ppc_of_probe, | 228 | .probe = ehci_hcd_ppc_of_probe, |
238 | .remove = ehci_hcd_ppc_of_remove, | 229 | .remove = ehci_hcd_ppc_of_remove, |
239 | .shutdown = ehci_hcd_ppc_of_shutdown, | 230 | .shutdown = usb_hcd_platform_shutdown, |
240 | .driver = { | 231 | .driver = { |
241 | .name = "ppc-of-ehci", | 232 | .name = "ppc-of-ehci", |
242 | .owner = THIS_MODULE, | 233 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 7cc26e621aa7..aba645bd4866 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c | |||
@@ -220,14 +220,6 @@ static int s5p_ehci_remove(struct platform_device *pdev) | |||
220 | return 0; | 220 | return 0; |
221 | } | 221 | } |
222 | 222 | ||
223 | static void s5p_ehci_shutdown(struct platform_device *pdev) | ||
224 | { | ||
225 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | ||
226 | |||
227 | if (hcd->driver->shutdown) | ||
228 | hcd->driver->shutdown(hcd); | ||
229 | } | ||
230 | |||
231 | #ifdef CONFIG_PM | 223 | #ifdef CONFIG_PM |
232 | static int s5p_ehci_suspend(struct device *dev) | 224 | static int s5p_ehci_suspend(struct device *dev) |
233 | { | 225 | { |
@@ -297,7 +289,7 @@ MODULE_DEVICE_TABLE(of, exynos_ehci_match); | |||
297 | static struct platform_driver s5p_ehci_driver = { | 289 | static struct platform_driver s5p_ehci_driver = { |
298 | .probe = s5p_ehci_probe, | 290 | .probe = s5p_ehci_probe, |
299 | .remove = s5p_ehci_remove, | 291 | .remove = s5p_ehci_remove, |
300 | .shutdown = s5p_ehci_shutdown, | 292 | .shutdown = usb_hcd_platform_shutdown, |
301 | .driver = { | 293 | .driver = { |
302 | .name = "s5p-ehci", | 294 | .name = "s5p-ehci", |
303 | .owner = THIS_MODULE, | 295 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index 35c7f90384a6..eba962e6ebfb 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c | |||
@@ -220,21 +220,6 @@ static int ehci_hcd_xilinx_of_remove(struct platform_device *op) | |||
220 | return 0; | 220 | return 0; |
221 | } | 221 | } |
222 | 222 | ||
223 | /** | ||
224 | * ehci_hcd_xilinx_of_shutdown - shutdown the hcd | ||
225 | * @op: pointer to platform_device structure that is to be removed | ||
226 | * | ||
227 | * Properly shutdown the hcd, call driver's shutdown routine. | ||
228 | */ | ||
229 | static void ehci_hcd_xilinx_of_shutdown(struct platform_device *op) | ||
230 | { | ||
231 | struct usb_hcd *hcd = platform_get_drvdata(op); | ||
232 | |||
233 | if (hcd->driver->shutdown) | ||
234 | hcd->driver->shutdown(hcd); | ||
235 | } | ||
236 | |||
237 | |||
238 | static const struct of_device_id ehci_hcd_xilinx_of_match[] = { | 223 | static const struct of_device_id ehci_hcd_xilinx_of_match[] = { |
239 | {.compatible = "xlnx,xps-usb-host-1.00.a",}, | 224 | {.compatible = "xlnx,xps-usb-host-1.00.a",}, |
240 | {}, | 225 | {}, |
@@ -244,7 +229,7 @@ MODULE_DEVICE_TABLE(of, ehci_hcd_xilinx_of_match); | |||
244 | static struct platform_driver ehci_hcd_xilinx_of_driver = { | 229 | static struct platform_driver ehci_hcd_xilinx_of_driver = { |
245 | .probe = ehci_hcd_xilinx_of_probe, | 230 | .probe = ehci_hcd_xilinx_of_probe, |
246 | .remove = ehci_hcd_xilinx_of_remove, | 231 | .remove = ehci_hcd_xilinx_of_remove, |
247 | .shutdown = ehci_hcd_xilinx_of_shutdown, | 232 | .shutdown = usb_hcd_platform_shutdown, |
248 | .driver = { | 233 | .driver = { |
249 | .name = "xilinx-of-ehci", | 234 | .name = "xilinx-of-ehci", |
250 | .owner = THIS_MODULE, | 235 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c index 8f713571a0b7..a09af26f69ed 100644 --- a/drivers/usb/host/ohci-omap3.c +++ b/drivers/usb/host/ohci-omap3.c | |||
@@ -231,14 +231,6 @@ static int ohci_hcd_omap3_remove(struct platform_device *pdev) | |||
231 | return 0; | 231 | return 0; |
232 | } | 232 | } |
233 | 233 | ||
234 | static void ohci_hcd_omap3_shutdown(struct platform_device *pdev) | ||
235 | { | ||
236 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); | ||
237 | |||
238 | if (hcd->driver->shutdown) | ||
239 | hcd->driver->shutdown(hcd); | ||
240 | } | ||
241 | |||
242 | static const struct of_device_id omap_ohci_dt_ids[] = { | 234 | static const struct of_device_id omap_ohci_dt_ids[] = { |
243 | { .compatible = "ti,ohci-omap3" }, | 235 | { .compatible = "ti,ohci-omap3" }, |
244 | { } | 236 | { } |
@@ -249,7 +241,7 @@ MODULE_DEVICE_TABLE(of, omap_ohci_dt_ids); | |||
249 | static struct platform_driver ohci_hcd_omap3_driver = { | 241 | static struct platform_driver ohci_hcd_omap3_driver = { |
250 | .probe = ohci_hcd_omap3_probe, | 242 | .probe = ohci_hcd_omap3_probe, |
251 | .remove = ohci_hcd_omap3_remove, | 243 | .remove = ohci_hcd_omap3_remove, |
252 | .shutdown = ohci_hcd_omap3_shutdown, | 244 | .shutdown = usb_hcd_platform_shutdown, |
253 | .driver = { | 245 | .driver = { |
254 | .name = "ohci-omap3", | 246 | .name = "ohci-omap3", |
255 | .of_match_table = omap_ohci_dt_ids, | 247 | .of_match_table = omap_ohci_dt_ids, |
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c index 8294e2fcc2f6..75f5a1e2f01e 100644 --- a/drivers/usb/host/ohci-ppc-of.c +++ b/drivers/usb/host/ohci-ppc-of.c | |||
@@ -200,15 +200,6 @@ static int ohci_hcd_ppc_of_remove(struct platform_device *op) | |||
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||
203 | static void ohci_hcd_ppc_of_shutdown(struct platform_device *op) | ||
204 | { | ||
205 | struct usb_hcd *hcd = platform_get_drvdata(op); | ||
206 | |||
207 | if (hcd->driver->shutdown) | ||
208 | hcd->driver->shutdown(hcd); | ||
209 | } | ||
210 | |||
211 | |||
212 | static const struct of_device_id ohci_hcd_ppc_of_match[] = { | 203 | static const struct of_device_id ohci_hcd_ppc_of_match[] = { |
213 | #ifdef CONFIG_USB_OHCI_HCD_PPC_OF_BE | 204 | #ifdef CONFIG_USB_OHCI_HCD_PPC_OF_BE |
214 | { | 205 | { |
@@ -243,7 +234,7 @@ MODULE_DEVICE_TABLE(of, ohci_hcd_ppc_of_match); | |||
243 | static struct platform_driver ohci_hcd_ppc_of_driver = { | 234 | static struct platform_driver ohci_hcd_ppc_of_driver = { |
244 | .probe = ohci_hcd_ppc_of_probe, | 235 | .probe = ohci_hcd_ppc_of_probe, |
245 | .remove = ohci_hcd_ppc_of_remove, | 236 | .remove = ohci_hcd_ppc_of_remove, |
246 | .shutdown = ohci_hcd_ppc_of_shutdown, | 237 | .shutdown = usb_hcd_platform_shutdown, |
247 | .driver = { | 238 | .driver = { |
248 | .name = "ppc-of-ohci", | 239 | .name = "ppc-of-ohci", |
249 | .owner = THIS_MODULE, | 240 | .owner = THIS_MODULE, |