aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2015-01-16 16:56:02 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-02 13:11:25 -0500
commitcb8763417224340f9a6092092077c801ce686eba (patch)
tree8d630bbf75d44789789362939424e9389483a34e /drivers
parentc81622ac4282b0183e738e192c91fabe4a782715 (diff)
sh-sci: extend PM methods
In order to make it possible to restore from hibernation not only in Linux but also in e.g. U-Boot, we have to use sci_{suspend|remove}() for the PM {freeze| thaw|restore}() methods. It's handy to achieve this by using SIMPLE_DEV_PM_OPS() macro, however we have to annotate sci_{suspend|remove}() with '__maybe_unused' in order to avoid compilation warnings when CONFIG_PM_SLEEP is undefined. Based on orignal patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/sh-sci.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index e032963989fc..4f784f8bf264 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2605,7 +2605,7 @@ static int sci_probe(struct platform_device *dev)
2605 return 0; 2605 return 0;
2606} 2606}
2607 2607
2608static int sci_suspend(struct device *dev) 2608static __maybe_unused int sci_suspend(struct device *dev)
2609{ 2609{
2610 struct sci_port *sport = dev_get_drvdata(dev); 2610 struct sci_port *sport = dev_get_drvdata(dev);
2611 2611
@@ -2615,7 +2615,7 @@ static int sci_suspend(struct device *dev)
2615 return 0; 2615 return 0;
2616} 2616}
2617 2617
2618static int sci_resume(struct device *dev) 2618static __maybe_unused int sci_resume(struct device *dev)
2619{ 2619{
2620 struct sci_port *sport = dev_get_drvdata(dev); 2620 struct sci_port *sport = dev_get_drvdata(dev);
2621 2621
@@ -2625,10 +2625,7 @@ static int sci_resume(struct device *dev)
2625 return 0; 2625 return 0;
2626} 2626}
2627 2627
2628static const struct dev_pm_ops sci_dev_pm_ops = { 2628static SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume);
2629 .suspend = sci_suspend,
2630 .resume = sci_resume,
2631};
2632 2629
2633static struct platform_driver sci_driver = { 2630static struct platform_driver sci_driver = {
2634 .probe = sci_probe, 2631 .probe = sci_probe,