linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Stephen Boyd <swboyd@chromium.org>
Subject: [PATCH 03/32] Input: cros-ec-keyb - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Date: Sun,  4 Dec 2022 18:08:12 +0000	[thread overview]
Message-ID: <20221204180841.2211588-4-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>
Cc: Stephen Boyd <swboyd@chromium.org>
---
 drivers/input/keyboard/cros_ec_keyb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index c14136b733a9..6f435125ec03 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -415,7 +415,7 @@ static int cros_ec_keyb_query_switches(struct cros_ec_keyb *ckdev)
  *
  * Returns 0 if no error or -error upon error.
  */
-static __maybe_unused int cros_ec_keyb_resume(struct device *dev)
+static int cros_ec_keyb_resume(struct device *dev)
 {
 	struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
 
@@ -760,7 +760,7 @@ static const struct of_device_id cros_ec_keyb_of_match[] = {
 MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match);
 #endif
 
-static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
 
 static struct platform_driver cros_ec_keyb_driver = {
 	.probe = cros_ec_keyb_probe,
@@ -769,7 +769,7 @@ static struct platform_driver cros_ec_keyb_driver = {
 		.name = "cros-ec-keyb",
 		.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
 		.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
-		.pm = &cros_ec_keyb_pm_ops,
+		.pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
 	},
 };
 
-- 
2.38.1


  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 ` Jonathan Cameron [this message]
2022-12-07  0:41   ` [PATCH 03/32] Input: cros-ec-keyb " 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 ` [PATCH 06/32] Input: gpio-keys " Jonathan Cameron
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-4-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=swboyd@chromium.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).