diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-07-21 10:49:39 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-09-10 07:15:36 -0400 |
commit | b7f3f59b48112ba5ba1c1ffc093f02654e0ce97e (patch) | |
tree | 815b391ec00ee952b23f7c3e5af6e38df430bc0d /drivers/usb/host/ohci-pxa27x.c | |
parent | bf56c751fa25edf12528e7cef90fb276c3fff17a (diff) |
[ARM] pxa: update ohci-pxa27x.c to use 'struct dev_pm_ops'
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'drivers/usb/host/ohci-pxa27x.c')
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index e44dc2cbca24..61800742fc07 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -477,25 +477,25 @@ static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) | |||
477 | return 0; | 477 | return 0; |
478 | } | 478 | } |
479 | 479 | ||
480 | #ifdef CONFIG_PM | 480 | #ifdef CONFIG_PM |
481 | static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state) | 481 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev) |
482 | { | 482 | { |
483 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 483 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
484 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); | 484 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); |
485 | 485 | ||
486 | if (time_before(jiffies, ohci->ohci.next_statechange)) | 486 | if (time_before(jiffies, ohci->ohci.next_statechange)) |
487 | msleep(5); | 487 | msleep(5); |
488 | ohci->ohci.next_statechange = jiffies; | 488 | ohci->ohci.next_statechange = jiffies; |
489 | 489 | ||
490 | pxa27x_stop_hc(ohci, &pdev->dev); | 490 | pxa27x_stop_hc(ohci, dev); |
491 | hcd->state = HC_STATE_SUSPENDED; | 491 | hcd->state = HC_STATE_SUSPENDED; |
492 | 492 | ||
493 | return 0; | 493 | return 0; |
494 | } | 494 | } |
495 | 495 | ||
496 | static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) | 496 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev) |
497 | { | 497 | { |
498 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 498 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
499 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); | 499 | struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); |
500 | int status; | 500 | int status; |
501 | 501 | ||
@@ -503,12 +503,17 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) | |||
503 | msleep(5); | 503 | msleep(5); |
504 | ohci->ohci.next_statechange = jiffies; | 504 | ohci->ohci.next_statechange = jiffies; |
505 | 505 | ||
506 | if ((status = pxa27x_start_hc(ohci, &pdev->dev)) < 0) | 506 | if ((status = pxa27x_start_hc(ohci, dev)) < 0) |
507 | return status; | 507 | return status; |
508 | 508 | ||
509 | ohci_finish_controller_resume(hcd); | 509 | ohci_finish_controller_resume(hcd); |
510 | return 0; | 510 | return 0; |
511 | } | 511 | } |
512 | |||
513 | static struct dev_pm_ops ohci_hcd_pxa27x_pm_ops = { | ||
514 | .suspend = ohci_hcd_pxa27x_drv_suspend, | ||
515 | .resume = ohci_hcd_pxa27x_drv_resume, | ||
516 | }; | ||
512 | #endif | 517 | #endif |
513 | 518 | ||
514 | /* work with hotplug and coldplug */ | 519 | /* work with hotplug and coldplug */ |
@@ -518,13 +523,12 @@ static struct platform_driver ohci_hcd_pxa27x_driver = { | |||
518 | .probe = ohci_hcd_pxa27x_drv_probe, | 523 | .probe = ohci_hcd_pxa27x_drv_probe, |
519 | .remove = ohci_hcd_pxa27x_drv_remove, | 524 | .remove = ohci_hcd_pxa27x_drv_remove, |
520 | .shutdown = usb_hcd_platform_shutdown, | 525 | .shutdown = usb_hcd_platform_shutdown, |
521 | #ifdef CONFIG_PM | ||
522 | .suspend = ohci_hcd_pxa27x_drv_suspend, | ||
523 | .resume = ohci_hcd_pxa27x_drv_resume, | ||
524 | #endif | ||
525 | .driver = { | 526 | .driver = { |
526 | .name = "pxa27x-ohci", | 527 | .name = "pxa27x-ohci", |
527 | .owner = THIS_MODULE, | 528 | .owner = THIS_MODULE, |
529 | #ifdef CONFIG_PM | ||
530 | .pm = &ohci_hcd_pxa27x_pm_ops, | ||
531 | #endif | ||
528 | }, | 532 | }, |
529 | }; | 533 | }; |
530 | 534 | ||