From: Paul Bolle <pebolle@tiscali.nl>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>
Cc: Valentin Rothberg <valentinrothberg@gmail.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] [linux-next] sprd_serial: compile sprd_suspend and sprd_resume conditionally
Date: Tue, 03 Feb 2015 21:05:50 +0100 [thread overview]
Message-ID: <1422993950.23894.16.camel@x220> (raw)
Building sprd_serial.o when CONFIG_PM_SLEEP is not defined triggers
these warnings:
drivers/tty/serial/sprd_serial.c:755:12: warning: ‘sprd_suspend’ defined but not used [-Wunused-function]
static int sprd_suspend(struct device *dev)
^
drivers/tty/serial/sprd_serial.c:764:12: warning: ‘sprd_resume’ defined but not used [-Wunused-function]
static int sprd_resume(struct device *dev)
^
Let's compile these functions only when CONFIG_PM_SLEEP is defined.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
The only reason I looked into this driver is because it landed in
today's linux-next (ie, next-20150203) and depends on ARCH_SPRD.
ARCH_SPRD is not yet included in linux-next. Since there was a patch
submitted on lkml recently to add that symbol that's not a big deal.
(That might change if that symbol doesn't make it into v3.20-rc[123] or
so.) But I did compile this file while looking into this issue.
Compile tested only, on x86_64, using the hacky
make drivers/tty/serial/sprd_serial.o
way to compile this file!
drivers/tty/serial/sprd_serial.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index 594b63331ef4..be3ed3f4ad60 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -752,6 +752,7 @@ static int sprd_probe(struct platform_device *pdev)
return ret;
}
+#ifdef CONFIG_PM_SLEEP
static int sprd_suspend(struct device *dev)
{
struct sprd_uart_port *sup = dev_get_drvdata(dev);
@@ -769,6 +770,7 @@ static int sprd_resume(struct device *dev)
return 0;
}
+#endif
static SIMPLE_DEV_PM_OPS(sprd_pm_ops, sprd_suspend, sprd_resume);
--
1.9.3
reply other threads:[~2015-02-03 20:05 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=1422993950.23894.16.camel@x220 \
--to=pebolle@tiscali.nl \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=valentinrothberg@gmail.com \
/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