diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/usb/host/ohci-pxa27x.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) |
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-pxa27x.c')
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 59e20568e8f9..9d65ec307990 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -290,9 +290,8 @@ static const struct hc_driver ohci_pxa27x_hc_driver = { | |||
290 | 290 | ||
291 | /*-------------------------------------------------------------------------*/ | 291 | /*-------------------------------------------------------------------------*/ |
292 | 292 | ||
293 | static int ohci_hcd_pxa27x_drv_probe(struct device *dev) | 293 | static int ohci_hcd_pxa27x_drv_probe(struct platform_device *pdev) |
294 | { | 294 | { |
295 | struct platform_device *pdev = to_platform_device(dev); | ||
296 | int ret; | 295 | int ret; |
297 | 296 | ||
298 | pr_debug ("In ohci_hcd_pxa27x_drv_probe"); | 297 | pr_debug ("In ohci_hcd_pxa27x_drv_probe"); |
@@ -304,41 +303,39 @@ static int ohci_hcd_pxa27x_drv_probe(struct device *dev) | |||
304 | return ret; | 303 | return ret; |
305 | } | 304 | } |
306 | 305 | ||
307 | static int ohci_hcd_pxa27x_drv_remove(struct device *dev) | 306 | static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) |
308 | { | 307 | { |
309 | struct platform_device *pdev = to_platform_device(dev); | 308 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
310 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
311 | 309 | ||
312 | usb_hcd_pxa27x_remove(hcd, pdev); | 310 | usb_hcd_pxa27x_remove(hcd, pdev); |
313 | return 0; | 311 | return 0; |
314 | } | 312 | } |
315 | 313 | ||
316 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state) | 314 | static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *dev, pm_message_t state) |
317 | { | 315 | { |
318 | // struct platform_device *pdev = to_platform_device(dev); | 316 | // struct usb_hcd *hcd = platform_get_drvdata(dev); |
319 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
320 | printk("%s: not implemented yet\n", __FUNCTION__); | 317 | printk("%s: not implemented yet\n", __FUNCTION__); |
321 | 318 | ||
322 | return 0; | 319 | return 0; |
323 | } | 320 | } |
324 | 321 | ||
325 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev) | 322 | static int ohci_hcd_pxa27x_drv_resume(struct platform_device *dev) |
326 | { | 323 | { |
327 | // struct platform_device *pdev = to_platform_device(dev); | 324 | // struct usb_hcd *hcd = platform_get_drvdata(dev); |
328 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
329 | printk("%s: not implemented yet\n", __FUNCTION__); | 325 | printk("%s: not implemented yet\n", __FUNCTION__); |
330 | 326 | ||
331 | return 0; | 327 | return 0; |
332 | } | 328 | } |
333 | 329 | ||
334 | 330 | ||
335 | static struct device_driver ohci_hcd_pxa27x_driver = { | 331 | static struct platform_driver ohci_hcd_pxa27x_driver = { |
336 | .name = "pxa27x-ohci", | ||
337 | .bus = &platform_bus_type, | ||
338 | .probe = ohci_hcd_pxa27x_drv_probe, | 332 | .probe = ohci_hcd_pxa27x_drv_probe, |
339 | .remove = ohci_hcd_pxa27x_drv_remove, | 333 | .remove = ohci_hcd_pxa27x_drv_remove, |
340 | .suspend = ohci_hcd_pxa27x_drv_suspend, | 334 | .suspend = ohci_hcd_pxa27x_drv_suspend, |
341 | .resume = ohci_hcd_pxa27x_drv_resume, | 335 | .resume = ohci_hcd_pxa27x_drv_resume, |
336 | .driver = { | ||
337 | .name = "pxa27x-ohci", | ||
338 | }, | ||
342 | }; | 339 | }; |
343 | 340 | ||
344 | static int __init ohci_hcd_pxa27x_init (void) | 341 | static int __init ohci_hcd_pxa27x_init (void) |
@@ -347,12 +344,12 @@ static int __init ohci_hcd_pxa27x_init (void) | |||
347 | pr_debug ("block sizes: ed %d td %d\n", | 344 | pr_debug ("block sizes: ed %d td %d\n", |
348 | sizeof (struct ed), sizeof (struct td)); | 345 | sizeof (struct ed), sizeof (struct td)); |
349 | 346 | ||
350 | return driver_register(&ohci_hcd_pxa27x_driver); | 347 | return platform_driver_register(&ohci_hcd_pxa27x_driver); |
351 | } | 348 | } |
352 | 349 | ||
353 | static void __exit ohci_hcd_pxa27x_cleanup (void) | 350 | static void __exit ohci_hcd_pxa27x_cleanup (void) |
354 | { | 351 | { |
355 | driver_unregister(&ohci_hcd_pxa27x_driver); | 352 | platform_driver_unregister(&ohci_hcd_pxa27x_driver); |
356 | } | 353 | } |
357 | 354 | ||
358 | module_init (ohci_hcd_pxa27x_init); | 355 | module_init (ohci_hcd_pxa27x_init); |