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>,
	Yassine Oudjana <y.oudjana@protonmail.com>
Subject: [PATCH 04/32] Input: cypress-sf - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Date: Sun,  4 Dec 2022 18:08:13 +0000	[thread overview]
Message-ID: <20221204180841.2211588-5-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: Yassine Oudjana <y.oudjana@protonmail.com>
---
 drivers/input/keyboard/cypress-sf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/cypress-sf.c b/drivers/input/keyboard/cypress-sf.c
index 9a23eed6a4f4..686388f40317 100644
--- a/drivers/input/keyboard/cypress-sf.c
+++ b/drivers/input/keyboard/cypress-sf.c
@@ -168,7 +168,7 @@ static int cypress_sf_probe(struct i2c_client *client)
 	return 0;
 };
 
-static int __maybe_unused cypress_sf_suspend(struct device *dev)
+static int cypress_sf_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
@@ -187,7 +187,7 @@ static int __maybe_unused cypress_sf_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused cypress_sf_resume(struct device *dev)
+static int cypress_sf_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
@@ -205,8 +205,8 @@ static int __maybe_unused cypress_sf_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
-			 cypress_sf_suspend, cypress_sf_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
+				cypress_sf_suspend, cypress_sf_resume);
 
 static struct i2c_device_id cypress_sf_id_table[] = {
 	{ CYPRESS_SF_DEV_NAME, 0 },
@@ -225,7 +225,7 @@ MODULE_DEVICE_TABLE(of, cypress_sf_of_match);
 static struct i2c_driver cypress_sf_driver = {
 	.driver = {
 		.name = CYPRESS_SF_DEV_NAME,
-		.pm = &cypress_sf_pm_ops,
+		.pm = pm_sleep_ptr(&cypress_sf_pm_ops),
 		.of_match_table = of_match_ptr(cypress_sf_of_match),
 	},
 	.id_table = cypress_sf_id_table,
-- 
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 ` [PATCH 03/32] Input: cros-ec-keyb " Jonathan Cameron
2022-12-07  0:41   ` Stephen Boyd
2022-12-04 18:08 ` Jonathan Cameron [this message]
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-5-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=y.oudjana@protonmail.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;
as well as URLs for NNTP newsgroup(s).