aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWonhong Kwon <wonhongkwon@gmail.com>2014-10-24 00:45:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-03 18:38:17 -0500
commit5e4ccd9ee2508d04a39fa27de9eb7bf65bad7594 (patch)
treee9d499feb97308959792dc86f0560326e541320a
parenta57971bfa1e9aa9b42ed72df027d5b985b31b56b (diff)
usb: ehci/ohci-platform: use SIMPLE_DEV_PM_OPS to support hibernation
ehci/ohci-platform just define .suspend/.resume functions for dev_pm_ops, but in order to support both STR(suspend-to-ram) and hibernation, other callbacks such as .freeze/.thaw are also required. Registering all required callbacks for both STR and hibernation can be done by SIMPLE_DEV_PM_OPS macro function. Signed-off-by: Wonhong Kwon <wonhong.kwon@lge.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/ehci-platform.c15
-rw-r--r--drivers/usb/host/ohci-platform.c15
2 files changed, 8 insertions, 22 deletions
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 2f5b9ce3e042..da056fe9d15b 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -311,8 +311,7 @@ static int ehci_platform_remove(struct platform_device *dev)
311 return 0; 311 return 0;
312} 312}
313 313
314#ifdef CONFIG_PM 314#ifdef CONFIG_PM_SLEEP
315
316static int ehci_platform_suspend(struct device *dev) 315static int ehci_platform_suspend(struct device *dev)
317{ 316{
318 struct usb_hcd *hcd = dev_get_drvdata(dev); 317 struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -348,11 +347,7 @@ static int ehci_platform_resume(struct device *dev)
348 ehci_resume(hcd, false); 347 ehci_resume(hcd, false);
349 return 0; 348 return 0;
350} 349}
351 350#endif /* CONFIG_PM_SLEEP */
352#else /* !CONFIG_PM */
353#define ehci_platform_suspend NULL
354#define ehci_platform_resume NULL
355#endif /* CONFIG_PM */
356 351
357static const struct of_device_id vt8500_ehci_ids[] = { 352static const struct of_device_id vt8500_ehci_ids[] = {
358 { .compatible = "via,vt8500-ehci", }, 353 { .compatible = "via,vt8500-ehci", },
@@ -368,10 +363,8 @@ static const struct platform_device_id ehci_platform_table[] = {
368}; 363};
369MODULE_DEVICE_TABLE(platform, ehci_platform_table); 364MODULE_DEVICE_TABLE(platform, ehci_platform_table);
370 365
371static const struct dev_pm_ops ehci_platform_pm_ops = { 366static SIMPLE_DEV_PM_OPS(ehci_platform_pm_ops, ehci_platform_suspend,
372 .suspend = ehci_platform_suspend, 367 ehci_platform_resume);
373 .resume = ehci_platform_resume,
374};
375 368
376static struct platform_driver ehci_platform_driver = { 369static struct platform_driver ehci_platform_driver = {
377 .id_table = ehci_platform_table, 370 .id_table = ehci_platform_table,
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index 7793c3cfcf1f..adb691d3087c 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -293,8 +293,7 @@ static int ohci_platform_remove(struct platform_device *dev)
293 return 0; 293 return 0;
294} 294}
295 295
296#ifdef CONFIG_PM 296#ifdef CONFIG_PM_SLEEP
297
298static int ohci_platform_suspend(struct device *dev) 297static int ohci_platform_suspend(struct device *dev)
299{ 298{
300 struct usb_hcd *hcd = dev_get_drvdata(dev); 299 struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -330,11 +329,7 @@ static int ohci_platform_resume(struct device *dev)
330 ohci_resume(hcd, false); 329 ohci_resume(hcd, false);
331 return 0; 330 return 0;
332} 331}
333 332#endif /* CONFIG_PM_SLEEP */
334#else /* !CONFIG_PM */
335#define ohci_platform_suspend NULL
336#define ohci_platform_resume NULL
337#endif /* CONFIG_PM */
338 333
339static const struct of_device_id ohci_platform_ids[] = { 334static const struct of_device_id ohci_platform_ids[] = {
340 { .compatible = "generic-ohci", }, 335 { .compatible = "generic-ohci", },
@@ -348,10 +343,8 @@ static const struct platform_device_id ohci_platform_table[] = {
348}; 343};
349MODULE_DEVICE_TABLE(platform, ohci_platform_table); 344MODULE_DEVICE_TABLE(platform, ohci_platform_table);
350 345
351static const struct dev_pm_ops ohci_platform_pm_ops = { 346static SIMPLE_DEV_PM_OPS(ohci_platform_pm_ops, ohci_platform_suspend,
352 .suspend = ohci_platform_suspend, 347 ohci_platform_resume);
353 .resume = ohci_platform_resume,
354};
355 348
356static struct platform_driver ohci_platform_driver = { 349static struct platform_driver ohci_platform_driver = {
357 .id_table = ohci_platform_table, 350 .id_table = ohci_platform_table,