From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: gregkh@linuxfoundation.org, jslaby@suse.cz, linux-serial@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Subject: [PATCH v2] sh-sci: extend PM methods
Date: Tue, 20 Jan 2015 01:41:48 +0300 [thread overview]
Message-ID: <2058633.0nQGRBdejF@wasted.cogentembedded.com> (raw)
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|resume}() 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 original patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.
Changes in version 2:
- fixed typos and too long line in the changelog.
drivers/tty/serial/sh-sci.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: tty/drivers/tty/serial/sh-sci.c
===================================================================
--- tty.orig/drivers/tty/serial/sh-sci.c
+++ tty/drivers/tty/serial/sh-sci.c
@@ -2605,7 +2605,7 @@ static int sci_probe(struct platform_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);
@@ -2615,7 +2615,7 @@ static int sci_suspend(struct device *de
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);
@@ -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,
reply other threads:[~2015-01-19 22:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2058633.0nQGRBdejF@wasted.cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-serial@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).