Skip to content

Commit

Permalink
sh-sci: extend PM methods
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergei Shtylyov authored and Greg Kroah-Hartman committed Feb 2, 2015
1 parent c81622a commit cb87634
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@ static int sci_probe(struct platform_device *dev)
return 0;
}

static int sci_suspend(struct device *dev)
static __maybe_unused int sci_suspend(struct device *dev)
{
struct sci_port *sport = dev_get_drvdata(dev);

Expand All @@ -2615,7 +2615,7 @@ static int sci_suspend(struct device *dev)
return 0;
}

static int sci_resume(struct device *dev)
static __maybe_unused int sci_resume(struct device *dev)
{
struct sci_port *sport = dev_get_drvdata(dev);

Expand All @@ -2625,10 +2625,7 @@ static int sci_resume(struct device *dev)
return 0;
}

static const struct dev_pm_ops sci_dev_pm_ops = {
.suspend = sci_suspend,
.resume = sci_resume,
};
static SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume);

static struct platform_driver sci_driver = {
.probe = sci_probe,
Expand Down

0 comments on commit cb87634

Please sign in to comment.