aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-omap.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /drivers/usb/host/ohci-omap.c
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (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-omap.c')
-rw-r--r--drivers/usb/host/ohci-omap.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index e46cc540cf4d..c9e29d808711 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -433,24 +433,22 @@ static const struct hc_driver ohci_omap_hc_driver = {
433 433
434/*-------------------------------------------------------------------------*/ 434/*-------------------------------------------------------------------------*/
435 435
436static int ohci_hcd_omap_drv_probe(struct device *dev) 436static int ohci_hcd_omap_drv_probe(struct platform_device *dev)
437{ 437{
438 return usb_hcd_omap_probe(&ohci_omap_hc_driver, 438 return usb_hcd_omap_probe(&ohci_omap_hc_driver, dev);
439 to_platform_device(dev));
440} 439}
441 440
442static int ohci_hcd_omap_drv_remove(struct device *dev) 441static int ohci_hcd_omap_drv_remove(struct platform_device *dev)
443{ 442{
444 struct platform_device *pdev = to_platform_device(dev); 443 struct usb_hcd *hcd = platform_get_drvdata(dev);
445 struct usb_hcd *hcd = dev_get_drvdata(dev);
446 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 444 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
447 445
448 usb_hcd_omap_remove(hcd, pdev); 446 usb_hcd_omap_remove(hcd, dev);
449 if (ohci->transceiver) { 447 if (ohci->transceiver) {
450 (void) otg_set_host(ohci->transceiver, 0); 448 (void) otg_set_host(ohci->transceiver, 0);
451 put_device(ohci->transceiver->dev); 449 put_device(ohci->transceiver->dev);
452 } 450 }
453 dev_set_drvdata(dev, NULL); 451 platform_set_drvdata(dev, NULL);
454 452
455 return 0; 453 return 0;
456} 454}
@@ -459,9 +457,9 @@ static int ohci_hcd_omap_drv_remove(struct device *dev)
459 457
460#ifdef CONFIG_PM 458#ifdef CONFIG_PM
461 459
462static int ohci_omap_suspend(struct device *dev, pm_message_t message) 460static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message)
463{ 461{
464 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); 462 struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev));
465 463
466 if (time_before(jiffies, ohci->next_statechange)) 464 if (time_before(jiffies, ohci->next_statechange))
467 msleep(5); 465 msleep(5);
@@ -473,9 +471,9 @@ static int ohci_omap_suspend(struct device *dev, pm_message_t message)
473 return 0; 471 return 0;
474} 472}
475 473
476static int ohci_omap_resume(struct device *dev) 474static int ohci_omap_resume(struct platform_device *dev)
477{ 475{
478 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); 476 struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev));
479 477
480 if (time_before(jiffies, ohci->next_statechange)) 478 if (time_before(jiffies, ohci->next_statechange))
481 msleep(5); 479 msleep(5);
@@ -494,16 +492,17 @@ static int ohci_omap_resume(struct device *dev)
494/* 492/*
495 * Driver definition to register with the OMAP bus 493 * Driver definition to register with the OMAP bus
496 */ 494 */
497static struct device_driver ohci_hcd_omap_driver = { 495static struct platform_driver ohci_hcd_omap_driver = {
498 .name = "ohci",
499 .owner = THIS_MODULE,
500 .bus = &platform_bus_type,
501 .probe = ohci_hcd_omap_drv_probe, 496 .probe = ohci_hcd_omap_drv_probe,
502 .remove = ohci_hcd_omap_drv_remove, 497 .remove = ohci_hcd_omap_drv_remove,
503#ifdef CONFIG_PM 498#ifdef CONFIG_PM
504 .suspend = ohci_omap_suspend, 499 .suspend = ohci_omap_suspend,
505 .resume = ohci_omap_resume, 500 .resume = ohci_omap_resume,
506#endif 501#endif
502 .driver = {
503 .owner = THIS_MODULE,
504 .name = "ohci",
505 },
507}; 506};
508 507
509static int __init ohci_hcd_omap_init (void) 508static int __init ohci_hcd_omap_init (void)
@@ -515,12 +514,12 @@ static int __init ohci_hcd_omap_init (void)
515 pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name, 514 pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
516 sizeof (struct ed), sizeof (struct td)); 515 sizeof (struct ed), sizeof (struct td));
517 516
518 return driver_register(&ohci_hcd_omap_driver); 517 return platform_driver_register(&ohci_hcd_omap_driver);
519} 518}
520 519
521static void __exit ohci_hcd_omap_cleanup (void) 520static void __exit ohci_hcd_omap_cleanup (void)
522{ 521{
523 driver_unregister(&ohci_hcd_omap_driver); 522 platform_driver_unregister(&ohci_hcd_omap_driver);
524} 523}
525 524
526module_init (ohci_hcd_omap_init); 525module_init (ohci_hcd_omap_init);