diff options
author | Dinh Nguyen <dinguyen@opensource.altera.com> | 2014-11-11 12:13:35 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-14 15:59:38 -0500 |
commit | bcc06078ba4da9a8b92342e7005c65ba4c06bdb9 (patch) | |
tree | d0e2491198671d7d692a6091c23c0e00427d5d86 /drivers/usb/dwc2/platform.c | |
parent | 117777b2c3bb961ba1cb9943dee93f192d7a3abd (diff) |
usb: dwc2: convert to use dev_pm_ops API
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>
Diffstat (limited to 'drivers/usb/dwc2/platform.c')
-rw-r--r-- | drivers/usb/dwc2/platform.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index eeba8a44f799..b94867ba9ccf 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -219,9 +219,9 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
219 | return retval; | 219 | return retval; |
220 | } | 220 | } |
221 | 221 | ||
222 | static int dwc2_suspend(struct platform_device *dev, pm_message_t state) | 222 | static int dwc2_suspend(struct device *dev) |
223 | { | 223 | { |
224 | struct dwc2_hsotg *dwc2 = platform_get_drvdata(dev); | 224 | struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); |
225 | int ret = 0; | 225 | int ret = 0; |
226 | 226 | ||
227 | if (dwc2_is_device_mode(dwc2)) | 227 | if (dwc2_is_device_mode(dwc2)) |
@@ -229,9 +229,9 @@ static int dwc2_suspend(struct platform_device *dev, pm_message_t state) | |||
229 | return ret; | 229 | return ret; |
230 | } | 230 | } |
231 | 231 | ||
232 | static int dwc2_resume(struct platform_device *dev) | 232 | static int dwc2_resume(struct device *dev) |
233 | { | 233 | { |
234 | struct dwc2_hsotg *dwc2 = platform_get_drvdata(dev); | 234 | struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); |
235 | int ret = 0; | 235 | int ret = 0; |
236 | 236 | ||
237 | if (dwc2_is_device_mode(dwc2)) | 237 | if (dwc2_is_device_mode(dwc2)) |
@@ -239,15 +239,18 @@ static int dwc2_resume(struct platform_device *dev) | |||
239 | return ret; | 239 | return ret; |
240 | } | 240 | } |
241 | 241 | ||
242 | static const struct dev_pm_ops dwc2_dev_pm_ops = { | ||
243 | SET_SYSTEM_SLEEP_PM_OPS(dwc2_suspend, dwc2_resume) | ||
244 | }; | ||
245 | |||
242 | static struct platform_driver dwc2_platform_driver = { | 246 | static struct platform_driver dwc2_platform_driver = { |
243 | .driver = { | 247 | .driver = { |
244 | .name = dwc2_driver_name, | 248 | .name = dwc2_driver_name, |
245 | .of_match_table = dwc2_of_match_table, | 249 | .of_match_table = dwc2_of_match_table, |
250 | .pm = &dwc2_dev_pm_ops, | ||
246 | }, | 251 | }, |
247 | .probe = dwc2_driver_probe, | 252 | .probe = dwc2_driver_probe, |
248 | .remove = dwc2_driver_remove, | 253 | .remove = dwc2_driver_remove, |
249 | .suspend = dwc2_suspend, | ||
250 | .resume = dwc2_resume, | ||
251 | }; | 254 | }; |
252 | 255 | ||
253 | module_platform_driver(dwc2_platform_driver); | 256 | module_platform_driver(dwc2_platform_driver); |