Skip to content

Commit

Permalink
usb: dwc2: convert to use dev_pm_ops API
Browse files Browse the repository at this point in the history
Update suspend/resume to use dev_pm_ops API.

Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Dinh Nguyen authored and Felipe Balbi committed Nov 14, 2014
1 parent 117777b commit bcc0607
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/usb/dwc2/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,35 +219,38 @@ static int dwc2_driver_probe(struct platform_device *dev)
return retval;
}

static int dwc2_suspend(struct platform_device *dev, pm_message_t state)
static int dwc2_suspend(struct device *dev)
{
struct dwc2_hsotg *dwc2 = platform_get_drvdata(dev);
struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);
int ret = 0;

if (dwc2_is_device_mode(dwc2))
ret = s3c_hsotg_suspend(dwc2);
return ret;
}

static int dwc2_resume(struct platform_device *dev)
static int dwc2_resume(struct device *dev)
{
struct dwc2_hsotg *dwc2 = platform_get_drvdata(dev);
struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);
int ret = 0;

if (dwc2_is_device_mode(dwc2))
ret = s3c_hsotg_resume(dwc2);
return ret;
}

static const struct dev_pm_ops dwc2_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc2_suspend, dwc2_resume)
};

static struct platform_driver dwc2_platform_driver = {
.driver = {
.name = dwc2_driver_name,
.of_match_table = dwc2_of_match_table,
.pm = &dwc2_dev_pm_ops,
},
.probe = dwc2_driver_probe,
.remove = dwc2_driver_remove,
.suspend = dwc2_suspend,
.resume = dwc2_resume,
};

module_platform_driver(dwc2_platform_driver);
Expand Down

0 comments on commit bcc0607

Please sign in to comment.