From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Michael Hennerich <michael.hennerich@analog.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] Input: adp5588-keys - drop CONFIG_PM guards
Date: Fri, 27 May 2022 21:56:28 -0700 [thread overview]
Message-ID: <20220528045631.289821-1-dmitry.torokhov@gmail.com> (raw)
To improve compile-time coverage let's drop #ifdef CONFIG_PM guards
and use SIMPLE_DEV_PM_OPS and __maybe_unused attributes and rely on
the linker to drop unused code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
Since we are talking about keeping the driver and switching it away from
platform data and towards device properties, here are some cleanups.
Only compiled, not tested.
drivers/input/keyboard/adp5588-keys.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index 1592da4de336..ea67d0834be1 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -612,8 +612,7 @@ static int adp5588_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM
-static int adp5588_suspend(struct device *dev)
+static int __maybe_unused adp5588_suspend(struct device *dev)
{
struct adp5588_kpad *kpad = dev_get_drvdata(dev);
struct i2c_client *client = kpad->client;
@@ -627,7 +626,7 @@ static int adp5588_suspend(struct device *dev)
return 0;
}
-static int adp5588_resume(struct device *dev)
+static int __maybe_unused adp5588_resume(struct device *dev)
{
struct adp5588_kpad *kpad = dev_get_drvdata(dev);
struct i2c_client *client = kpad->client;
@@ -640,11 +639,7 @@ static int adp5588_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops adp5588_dev_pm_ops = {
- .suspend = adp5588_suspend,
- .resume = adp5588_resume,
-};
-#endif
+static SIMPLE_DEV_PM_OPS(adp5588_dev_pm_ops, adp5588_suspend, adp5588_resume);
static const struct i2c_device_id adp5588_id[] = {
{ "adp5588-keys", 0 },
@@ -656,9 +651,7 @@ MODULE_DEVICE_TABLE(i2c, adp5588_id);
static struct i2c_driver adp5588_driver = {
.driver = {
.name = KBUILD_MODNAME,
-#ifdef CONFIG_PM
.pm = &adp5588_dev_pm_ops,
-#endif
},
.probe = adp5588_probe,
.remove = adp5588_remove,
--
2.36.1.124.g0e6072fb45-goog
next reply other threads:[~2022-05-28 4:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-28 4:56 Dmitry Torokhov [this message]
2022-05-28 4:56 ` [PATCH 2/4] Input: adp5588-keys - switch to using threaded interrupt Dmitry Torokhov
2022-05-30 10:10 ` Hennerich, Michael
2022-05-28 4:56 ` [PATCH 3/4] Input: adp5588-keys - switch to using managed resources Dmitry Torokhov
2022-05-28 19:37 ` Uwe Kleine-König
2022-05-29 5:22 ` Dmitry Torokhov
2022-05-29 6:11 ` Uwe Kleine-König
2022-05-30 10:11 ` Hennerich, Michael
2022-05-28 4:56 ` [PATCH 4/4] Input: adp5588-keys - do not explicitly set device as wakeup source Dmitry Torokhov
2022-05-30 10:11 ` Hennerich, Michael
2022-05-30 10:06 ` [PATCH 1/4] Input: adp5588-keys - drop CONFIG_PM guards Hennerich, Michael
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=20220528045631.289821-1-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=u.kleine-koenig@pengutronix.de \
/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).