提交 b7f3f59b 编写于 作者: M Mike Rapoport 提交者: Eric Miao

[ARM] pxa: update ohci-pxa27x.c to use 'struct dev_pm_ops'

Signed-off-by: NMike Rapoport <mike@compulab.co.il>
Signed-off-by: NEric Miao <eric.y.miao@gmail.com>
上级 bf56c751
...@@ -478,24 +478,24 @@ static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) ...@@ -478,24 +478,24 @@ static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state) static int ohci_hcd_pxa27x_drv_suspend(struct device *dev)
{ {
struct usb_hcd *hcd = platform_get_drvdata(pdev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd);
if (time_before(jiffies, ohci->ohci.next_statechange)) if (time_before(jiffies, ohci->ohci.next_statechange))
msleep(5); msleep(5);
ohci->ohci.next_statechange = jiffies; ohci->ohci.next_statechange = jiffies;
pxa27x_stop_hc(ohci, &pdev->dev); pxa27x_stop_hc(ohci, dev);
hcd->state = HC_STATE_SUSPENDED; hcd->state = HC_STATE_SUSPENDED;
return 0; return 0;
} }
static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) static int ohci_hcd_pxa27x_drv_resume(struct device *dev)
{ {
struct usb_hcd *hcd = platform_get_drvdata(pdev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd);
int status; int status;
...@@ -503,12 +503,17 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) ...@@ -503,12 +503,17 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
msleep(5); msleep(5);
ohci->ohci.next_statechange = jiffies; ohci->ohci.next_statechange = jiffies;
if ((status = pxa27x_start_hc(ohci, &pdev->dev)) < 0) if ((status = pxa27x_start_hc(ohci, dev)) < 0)
return status; return status;
ohci_finish_controller_resume(hcd); ohci_finish_controller_resume(hcd);
return 0; return 0;
} }
static struct dev_pm_ops ohci_hcd_pxa27x_pm_ops = {
.suspend = ohci_hcd_pxa27x_drv_suspend,
.resume = ohci_hcd_pxa27x_drv_resume,
};
#endif #endif
/* work with hotplug and coldplug */ /* work with hotplug and coldplug */
...@@ -518,13 +523,12 @@ static struct platform_driver ohci_hcd_pxa27x_driver = { ...@@ -518,13 +523,12 @@ static struct platform_driver ohci_hcd_pxa27x_driver = {
.probe = ohci_hcd_pxa27x_drv_probe, .probe = ohci_hcd_pxa27x_drv_probe,
.remove = ohci_hcd_pxa27x_drv_remove, .remove = ohci_hcd_pxa27x_drv_remove,
.shutdown = usb_hcd_platform_shutdown, .shutdown = usb_hcd_platform_shutdown,
#ifdef CONFIG_PM
.suspend = ohci_hcd_pxa27x_drv_suspend,
.resume = ohci_hcd_pxa27x_drv_resume,
#endif
.driver = { .driver = {
.name = "pxa27x-ohci", .name = "pxa27x-ohci",
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &ohci_hcd_pxa27x_pm_ops,
#endif
}, },
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册