From: Jonathan Cameron <jic23@kernel.org>
To: linux-input@vger.kernel.org, Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: [PATCH 06/32] Input: gpio-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Date: Sun, 4 Dec 2022 18:08:15 +0000 [thread overview]
Message-ID: <20221204180841.2211588-7-jic23@kernel.org> (raw)
In-Reply-To: <20221204180841.2211588-1-jic23@kernel.org>
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings. The new combination of pm_sleep_ptr()
and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
thus suppressing the warning, but still allowing the unused code to be
removed. Thus also drop the __maybe_unused markings.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/input/keyboard/gpio_keys.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index a5dc4ab87fa1..5496482a38c1 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -992,7 +992,7 @@ gpio_keys_disable_wakeup(struct gpio_keys_drvdata *ddata)
}
}
-static int __maybe_unused gpio_keys_suspend(struct device *dev)
+static int gpio_keys_suspend(struct device *dev)
{
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
struct input_dev *input = ddata->input;
@@ -1012,7 +1012,7 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused gpio_keys_resume(struct device *dev)
+static int gpio_keys_resume(struct device *dev)
{
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
struct input_dev *input = ddata->input;
@@ -1034,7 +1034,7 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
static void gpio_keys_shutdown(struct platform_device *pdev)
{
@@ -1050,7 +1050,7 @@ static struct platform_driver gpio_keys_device_driver = {
.shutdown = gpio_keys_shutdown,
.driver = {
.name = "gpio-keys",
- .pm = &gpio_keys_pm_ops,
+ .pm = pm_sleep_ptr(&gpio_keys_pm_ops),
.of_match_table = gpio_keys_of_match,
.dev_groups = gpio_keys_groups,
}
--
2.38.1
next prev parent reply other threads:[~2022-12-04 17:56 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
2022-12-04 18:08 ` [PATCH 01/32] Input: pxspad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Jonathan Cameron
2022-12-04 18:08 ` [PATCH 02/32] Input: adp5589-keys " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 03/32] Input: cros-ec-keyb " Jonathan Cameron
2022-12-07 0:41 ` Stephen Boyd
2022-12-04 18:08 ` [PATCH 04/32] Input: cypress-sf " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 05/32] Input: ep39xx-keypad " Jonathan Cameron
2022-12-04 18:08 ` Jonathan Cameron [this message]
2022-12-04 18:08 ` [PATCH 07/32] Input: ipaq-micro-keys " Jonathan Cameron
2022-12-06 23:43 ` Linus Walleij
2022-12-04 18:08 ` [PATCH 08/32] Input: mpr121-touchkey " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 09/32] Input: mtk-pmic-keys " Jonathan Cameron
2022-12-05 13:23 ` Mattijs Korpershoek
2022-12-04 18:08 ` [PATCH 10/32] Input: qt1050 " Jonathan Cameron
2022-12-05 8:59 ` Marco Felsch
2022-12-04 18:08 ` [PATCH 11/32] Input: spear-keyboard " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 12/32] Input: tm2-touchkey " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 13/32] Input: lm8323 " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 14/32] Input: lpc32xx-keys " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 15/32] Input: matrix-keypad " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 16/32] Input: max7359-keypad " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 17/32] Input: mcs-touchkey " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 18/32] Input: nomadik-ske-keypad " Jonathan Cameron
2022-12-06 23:43 ` Linus Walleij
2022-12-04 18:08 ` [PATCH 19/32] Input: pmic8xxx-keypad " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 20/32] Input: pxa27x_keypad " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 21/32] Input: qt1070 " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 22/32] Input: sh-keysc " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 23/32] Input: st-keyscan " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 24/32] Input: tc3589x " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 25/32] Input: tca6416-keypad " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 26/32] Input: tegra-kbc " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 27/32] Input: tegra-kbc - allow build with COMPILE_TEST Jonathan Cameron
2022-12-04 18:08 ` [PATCH 28/32] Input: spear-keyboard - improve build coverage using COMPILE_TEST Jonathan Cameron
2022-12-04 18:08 ` [PATCH 29/32] Input: pxa27xx-keypad - allow build with COMPILE_TEST Jonathan Cameron
2022-12-04 18:08 ` [PATCH 30/32] Input: nomadik-ske-keypad - allow building " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 31/32] Input: lpc32xx " Jonathan Cameron
2022-12-04 18:08 ` [PATCH 32/32] Input: pxspad: Fix unused data warning when force feedback not enabled Jonathan Cameron
2022-12-07 21:47 ` [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() 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=20221204180841.2211588-7-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@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).