From: Arnd Bergmann <arnd@arndb.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Hans de Goede <hdegoede@redhat.com>,
Siebren Vroegindeweij <siebren.vroegindeweij@hotmail.com>,
Rob Herring <robh@kernel.org>,
Michel Verlaan <michel.verl@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Input: eKTF2127: mark PM functions as __maybe_unused
Date: Fri, 30 Sep 2016 18:22:33 +0200 [thread overview]
Message-ID: <20160930162329.183073-1-arnd@arndb.de> (raw)
The newly added ektf2127 driver uses the SIMPLE_DEV_PM_OPS macro
to conditionally refer to the resume/suspend functions, which
causes a warning when CONFIG_PM_SLEEP is disabled:
drivers/input/touchscreen/ektf2127.c:168:12: error: 'ektf2127_resume' defined but not used [-Werror=unused-function]
drivers/input/touchscreen/ektf2127.c:156:12: error: 'ektf2127_suspend' defined but not used [-Werror=unused-function]
We could either put these functions inside of an #ifdef or
add __maybe_unused annotations. This uses the second approach,
which is generally more foolproof.
Fixes: 9ca5bf5029b6 ("Input: add support for Elan eKTF2127 touchscreen controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/input/touchscreen/ektf2127.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
index 31a2dd7f38aa..0ed34ff787ce 100644
--- a/drivers/input/touchscreen/ektf2127.c
+++ b/drivers/input/touchscreen/ektf2127.c
@@ -153,7 +153,7 @@ static void ektf2127_stop(struct input_dev *dev)
gpiod_set_value_cansleep(ts->power_gpios, 0);
}
-static int ektf2127_suspend(struct device *dev)
+static int __maybe_unused ektf2127_suspend(struct device *dev)
{
struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
@@ -165,7 +165,7 @@ static int ektf2127_suspend(struct device *dev)
return 0;
}
-static int ektf2127_resume(struct device *dev)
+static int __maybe_unused ektf2127_resume(struct device *dev)
{
struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
--
2.9.0
next reply other threads:[~2016-09-30 16:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 16:22 Arnd Bergmann [this message]
2016-09-30 22:37 ` [PATCH] Input: eKTF2127: mark PM functions as __maybe_unused Dmitry Torokhov
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=20160930162329.183073-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=dmitry.torokhov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michel.verl@gmail.com \
--cc=robh@kernel.org \
--cc=siebren.vroegindeweij@hotmail.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