Commit 94ac0e5d authored by Sylvain Rochet's avatar Sylvain Rochet Committed by Greg Kroah-Hartman

USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver

This patch replace struct platform_driver.{resume,suspend} PM bindings
to a new struct dev_pm_ops.
Signed-off-by: default avatarSylvain Rochet <sylvain.rochet@finsecur.com>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca2c1dc0
...@@ -595,11 +595,11 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) ...@@ -595,11 +595,11 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int static int
ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) ohci_hcd_at91_drv_suspend(struct device *dev)
{ {
struct usb_hcd *hcd = platform_get_drvdata(pdev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct ohci_hcd *ohci = hcd_to_ohci(hcd);
bool do_wakeup = device_may_wakeup(&pdev->dev); bool do_wakeup = device_may_wakeup(dev);
int ret; int ret;
if (do_wakeup) if (do_wakeup)
...@@ -631,11 +631,11 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) ...@@ -631,11 +631,11 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
return ret; return ret;
} }
static int ohci_hcd_at91_drv_resume(struct platform_device *pdev) static int ohci_hcd_at91_drv_resume(struct device *dev)
{ {
struct usb_hcd *hcd = platform_get_drvdata(pdev); struct usb_hcd *hcd = dev_get_drvdata(dev);
if (device_may_wakeup(&pdev->dev)) if (device_may_wakeup(dev))
disable_irq_wake(hcd->irq); disable_irq_wake(hcd->irq);
if (!clocked) if (!clocked)
...@@ -644,19 +644,18 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev) ...@@ -644,19 +644,18 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
ohci_resume(hcd, false); ohci_resume(hcd, false);
return 0; return 0;
} }
#else
#define ohci_hcd_at91_drv_suspend NULL
#define ohci_hcd_at91_drv_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(ohci_hcd_at91_pm_ops, ohci_hcd_at91_drv_suspend,
ohci_hcd_at91_drv_resume);
static struct platform_driver ohci_hcd_at91_driver = { static struct platform_driver ohci_hcd_at91_driver = {
.probe = ohci_hcd_at91_drv_probe, .probe = ohci_hcd_at91_drv_probe,
.remove = ohci_hcd_at91_drv_remove, .remove = ohci_hcd_at91_drv_remove,
.shutdown = usb_hcd_platform_shutdown, .shutdown = usb_hcd_platform_shutdown,
.suspend = ohci_hcd_at91_drv_suspend,
.resume = ohci_hcd_at91_drv_resume,
.driver = { .driver = {
.name = "at91_ohci", .name = "at91_ohci",
.pm = &ohci_hcd_at91_pm_ops,
.of_match_table = of_match_ptr(at91_ohci_dt_ids), .of_match_table = of_match_ptr(at91_ohci_dt_ids),
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment