linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2022-12-04 18:08 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
                   ` (32 more replies)
  0 siblings, 33 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Paul Cercueil, Tomohiro Yoshidomi,
	Michael Hennerich, Stephen Boyd, Yassine Oudjana, Linus Walleij,
	Michal Vokáč,
	Mattijs Korpershoek, Marco Felsch, Stephan Gerhold, Marek Vasut

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

As part of recent changes to the macros in linux/pm.h, the
SIMPLE_DEV_PM_OPS() macro is deprecated in favor of the comination
of DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().
More details in the relevant commit message.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1a3c7bb088266fa2db017be299f91f1c1894c857

The main advantage of the new versions is that they allow the compiler
to 'see' the callbacks registered, thus avoiding the need to either
protect them with ifdef guards or to mark them __maybe_unused.
The compiler then removes the structure and the callbacks as dead code
in event of !CONFIG_PM_SLEEP.

Ultimately to clean up the old macros the change needs to be done to
all instances of the SIMPLE_DEV_PM_OPS() in the kernel. There are similar
changes to be done for runtime PM macros and more complex PM handling.
This set is just meant to switch over some of the low hanging fruit in
a bite sized chunk.

Also included at the end of this series are:
* a warning fix for pxspad
* allowing various drivers to be build with CONFIG_COMPILE_TEST.

There was one case that really is architecture specific for which I
did only a partial build test.  I pushed these out in a branch that
0-day build and it didn't see any problems.

Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Tomohiro Yoshidomi <sylph23k@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Stephen Boyd <swboyd@chromium.org>
Cc: Yassine Oudjana <y.oudjana@protonmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Marek Vasut <marek.vasut@gmail.com>

Jonathan Cameron (32):
  Input: pxspad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: adp5589-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: cros-ec-keyb - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: cypress-sf - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ep39xx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: gpio-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ipaq-micro-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mpr121-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mtk-pmic-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: qt1050 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: spear-keyboard - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tm2-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: lm8323 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: lpc32xx-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: matrix-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: max7359-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mcs-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pmic8xxx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pxa27x_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: qt1070 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: st-keyscan - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tca6416-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tegra-kbc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tegra-kbc - allow build with COMPILE_TEST
  Input: spear-keyboard - improve build coverage using COMPILE_TEST
  Input: pxa27xx-keypad - allow build with COMPILE_TEST
  Input: nomadik-ske-keypad - allow building with COMPILE_TEST
  Input: lpc32xx - allow building with COMPILE_TEST
  Input: pxspad: Fix unused data warning when force feedback not
    enabled.

 drivers/input/joystick/psxpad-spi.c         |  9 ++++++---
 drivers/input/keyboard/Kconfig              | 10 +++++-----
 drivers/input/keyboard/adp5589-keys.c       |  8 ++++----
 drivers/input/keyboard/cros_ec_keyb.c       |  6 +++---
 drivers/input/keyboard/cypress-sf.c         | 10 +++++-----
 drivers/input/keyboard/ep93xx_keypad.c      | 10 +++++-----
 drivers/input/keyboard/gpio_keys.c          |  8 ++++----
 drivers/input/keyboard/ipaq-micro-keys.c    | 10 +++++-----
 drivers/input/keyboard/lm8323.c             |  6 ++----
 drivers/input/keyboard/lpc32xx-keys.c       |  8 +++-----
 drivers/input/keyboard/matrix_keypad.c      |  8 +++-----
 drivers/input/keyboard/max7359_keypad.c     |  6 ++----
 drivers/input/keyboard/mcs_touchkey.c       |  8 +++-----
 drivers/input/keyboard/mpr121_touchkey.c    |  8 ++++----
 drivers/input/keyboard/mtk-pmic-keys.c      | 10 +++++-----
 drivers/input/keyboard/nomadik-ske-keypad.c |  8 +++-----
 drivers/input/keyboard/pmic8xxx-keypad.c    |  8 +++-----
 drivers/input/keyboard/pxa27x_keypad.c      |  8 +++-----
 drivers/input/keyboard/qt1050.c             |  8 ++++----
 drivers/input/keyboard/qt1070.c             |  6 ++----
 drivers/input/keyboard/sh_keysc.c           |  8 +++-----
 drivers/input/keyboard/spear-keyboard.c     |  9 +++++----
 drivers/input/keyboard/st-keyscan.c         |  7 +++----
 drivers/input/keyboard/tc3589x-keypad.c     |  8 +++-----
 drivers/input/keyboard/tca6416-keypad.c     |  8 +++-----
 drivers/input/keyboard/tegra-kbc.c          |  7 +++----
 drivers/input/keyboard/tm2-touchkey.c       | 10 +++++-----
 27 files changed, 99 insertions(+), 121 deletions(-)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 01/32] Input: pxspad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  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 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 02/32] Input: adp5589-keys " Jonathan Cameron
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Tomohiro Yoshidomi

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against used 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: Tomohiro Yoshidomi <sylph23k@gmail.com>
---
 drivers/input/joystick/psxpad-spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c
index a32656064f39..2c395af13d42 100644
--- a/drivers/input/joystick/psxpad-spi.c
+++ b/drivers/input/joystick/psxpad-spi.c
@@ -371,7 +371,7 @@ static int psxpad_spi_probe(struct spi_device *spi)
 	return 0;
 }
 
-static int __maybe_unused psxpad_spi_suspend(struct device *dev)
+static int psxpad_spi_suspend(struct device *dev)
 {
 	struct spi_device *spi = to_spi_device(dev);
 	struct psxpad *pad = spi_get_drvdata(spi);
@@ -381,7 +381,7 @@ static int __maybe_unused psxpad_spi_suspend(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL);
+static DEFINE_SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL);
 
 static const struct spi_device_id psxpad_spi_id[] = {
 	{ "psxpad-spi", 0 },
@@ -392,7 +392,7 @@ MODULE_DEVICE_TABLE(spi, psxpad_spi_id);
 static struct spi_driver psxpad_spi_driver = {
 	.driver = {
 		.name = "psxpad-spi",
-		.pm = &psxpad_spi_pm,
+		.pm = pm_sleep_ptr(&psxpad_spi_pm),
 	},
 	.id_table = psxpad_spi_id,
 	.probe   = psxpad_spi_probe,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 02/32] Input: adp5589-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  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 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 03/32] Input: cros-ec-keyb " Jonathan Cameron
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Michael Hennerich

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: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/keyboard/adp5589-keys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c
index 25c9f6344bf2..38d7073863a8 100644
--- a/drivers/input/keyboard/adp5589-keys.c
+++ b/drivers/input/keyboard/adp5589-keys.c
@@ -1016,7 +1016,7 @@ static int adp5589_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused adp5589_suspend(struct device *dev)
+static int adp5589_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct adp5589_kpad *kpad = i2c_get_clientdata(client);
@@ -1027,7 +1027,7 @@ static int __maybe_unused adp5589_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused adp5589_resume(struct device *dev)
+static int adp5589_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct adp5589_kpad *kpad = i2c_get_clientdata(client);
@@ -1038,7 +1038,7 @@ static int __maybe_unused adp5589_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);
 
 static const struct i2c_device_id adp5589_id[] = {
 	{"adp5589-keys", ADP5589},
@@ -1052,7 +1052,7 @@ MODULE_DEVICE_TABLE(i2c, adp5589_id);
 static struct i2c_driver adp5589_driver = {
 	.driver = {
 		.name = KBUILD_MODNAME,
-		.pm = &adp5589_dev_pm_ops,
+		.pm = pm_sleep_ptr(&adp5589_dev_pm_ops),
 	},
 	.probe_new = adp5589_probe,
 	.id_table = adp5589_id,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 03/32] Input: cros-ec-keyb - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  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
  2022-12-07  0:41   ` Stephen Boyd
  2022-12-04 18:08 ` [PATCH 04/32] Input: cypress-sf " Jonathan Cameron
                   ` (29 subsequent siblings)
  32 siblings, 1 reply; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Stephen Boyd

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


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 04/32] Input: cypress-sf - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (2 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 03/32] Input: cros-ec-keyb " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 05/32] Input: ep39xx-keypad " Jonathan Cameron
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Yassine Oudjana

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


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 05/32] Input: ep39xx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (3 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 04/32] Input: cypress-sf " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 06/32] Input: gpio-keys " Jonathan Cameron
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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/ep93xx_keypad.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index f5bf7524722a..55075addcac2 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -178,7 +178,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
 }
 
 
-static int __maybe_unused ep93xx_keypad_suspend(struct device *dev)
+static int ep93xx_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
@@ -196,7 +196,7 @@ static int __maybe_unused ep93xx_keypad_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ep93xx_keypad_resume(struct device *dev)
+static int ep93xx_keypad_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
@@ -217,8 +217,8 @@ static int __maybe_unused ep93xx_keypad_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
-			 ep93xx_keypad_suspend, ep93xx_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
+				ep93xx_keypad_suspend, ep93xx_keypad_resume);
 
 static void ep93xx_keypad_release_gpio_action(void *_pdev)
 {
@@ -318,7 +318,7 @@ static int ep93xx_keypad_remove(struct platform_device *pdev)
 static struct platform_driver ep93xx_keypad_driver = {
 	.driver		= {
 		.name	= "ep93xx-keypad",
-		.pm	= &ep93xx_keypad_pm_ops,
+		.pm	= pm_sleep_ptr(&ep93xx_keypad_pm_ops),
 	},
 	.probe		= ep93xx_keypad_probe,
 	.remove		= ep93xx_keypad_remove,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 06/32] Input: gpio-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (4 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 05/32] Input: ep39xx-keypad " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 07/32] Input: ipaq-micro-keys " Jonathan Cameron
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 07/32] Input: ipaq-micro-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (5 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 06/32] Input: gpio-keys " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-06 23:43   ` Linus Walleij
  2022-12-04 18:08 ` [PATCH 08/32] Input: mpr121-touchkey " Jonathan Cameron
                   ` (25 subsequent siblings)
  32 siblings, 1 reply; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Linus Walleij

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: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/input/keyboard/ipaq-micro-keys.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/ipaq-micro-keys.c b/drivers/input/keyboard/ipaq-micro-keys.c
index 13a66a8e3411..7b509bce2b33 100644
--- a/drivers/input/keyboard/ipaq-micro-keys.c
+++ b/drivers/input/keyboard/ipaq-micro-keys.c
@@ -124,7 +124,7 @@ static int micro_key_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused micro_key_suspend(struct device *dev)
+static int micro_key_suspend(struct device *dev)
 {
 	struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
 
@@ -133,7 +133,7 @@ static int __maybe_unused micro_key_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused micro_key_resume(struct device *dev)
+static int micro_key_resume(struct device *dev)
 {
 	struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
 	struct input_dev *input = keys->input;
@@ -148,13 +148,13 @@ static int __maybe_unused micro_key_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops,
-			 micro_key_suspend, micro_key_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops,
+				micro_key_suspend, micro_key_resume);
 
 static struct platform_driver micro_key_device_driver = {
 	.driver = {
 		.name    = "ipaq-micro-keys",
-		.pm	= &micro_key_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&micro_key_dev_pm_ops),
 	},
 	.probe   = micro_key_probe,
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 08/32] Input: mpr121-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (6 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 07/32] Input: ipaq-micro-keys " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 09/32] Input: mtk-pmic-keys " Jonathan Cameron
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Michal Vokáč

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: Michal Vokáč <michal.vokac@ysoft.com>
---
 drivers/input/keyboard/mpr121_touchkey.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
index 4610ef55903c..74ad353462a3 100644
--- a/drivers/input/keyboard/mpr121_touchkey.c
+++ b/drivers/input/keyboard/mpr121_touchkey.c
@@ -340,7 +340,7 @@ static int mpr_touchkey_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused mpr_suspend(struct device *dev)
+static int mpr_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -352,7 +352,7 @@ static int __maybe_unused mpr_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mpr_resume(struct device *dev)
+static int mpr_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client);
@@ -366,7 +366,7 @@ static int __maybe_unused mpr_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
 
 static const struct i2c_device_id mpr121_id[] = {
 	{ "mpr121_touchkey", 0 },
@@ -385,7 +385,7 @@ MODULE_DEVICE_TABLE(of, mpr121_touchkey_dt_match_table);
 static struct i2c_driver mpr_touchkey_driver = {
 	.driver = {
 		.name	= "mpr121",
-		.pm	= &mpr121_touchkey_pm_ops,
+		.pm	= pm_sleep_ptr(&mpr121_touchkey_pm_ops),
 		.of_match_table = of_match_ptr(mpr121_touchkey_dt_match_table),
 	},
 	.id_table	= mpr121_id,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 09/32] Input: mtk-pmic-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (7 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 08/32] Input: mpr121-touchkey " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-05 13:23   ` Mattijs Korpershoek
  2022-12-04 18:08 ` [PATCH 10/32] Input: qt1050 " Jonathan Cameron
                   ` (23 subsequent siblings)
  32 siblings, 1 reply; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Mattijs Korpershoek

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: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 drivers/input/keyboard/mtk-pmic-keys.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 9b34da0ec260..3d4ffa25e3df 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -231,7 +231,7 @@ static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys,
 	return 0;
 }
 
-static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
+static int mtk_pmic_keys_suspend(struct device *dev)
 {
 	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
 	int index;
@@ -247,7 +247,7 @@ static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
+static int mtk_pmic_keys_resume(struct device *dev)
 {
 	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
 	int index;
@@ -263,8 +263,8 @@ static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
-			mtk_pmic_keys_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
+				mtk_pmic_keys_resume);
 
 static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
 	{
@@ -387,7 +387,7 @@ static struct platform_driver pmic_keys_pdrv = {
 	.driver = {
 		   .name = "mtk-pmic-keys",
 		   .of_match_table = of_mtk_pmic_keys_match_tbl,
-		   .pm = &mtk_pmic_keys_pm_ops,
+		   .pm = pm_sleep_ptr(&mtk_pmic_keys_pm_ops),
 	},
 };
 
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 10/32] Input: qt1050 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (8 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 09/32] Input: mtk-pmic-keys " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-05  8:59   ` Marco Felsch
  2022-12-04 18:08 ` [PATCH 11/32] Input: spear-keyboard " Jonathan Cameron
                   ` (22 subsequent siblings)
  32 siblings, 1 reply; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Marco Felsch

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: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/input/keyboard/qt1050.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c
index 403060d05c3b..317fe2b1f827 100644
--- a/drivers/input/keyboard/qt1050.c
+++ b/drivers/input/keyboard/qt1050.c
@@ -547,7 +547,7 @@ static int qt1050_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused qt1050_suspend(struct device *dev)
+static int qt1050_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct qt1050_priv *ts = i2c_get_clientdata(client);
@@ -563,7 +563,7 @@ static int __maybe_unused qt1050_suspend(struct device *dev)
 			    device_may_wakeup(dev) ? 125 : 0);
 }
 
-static int __maybe_unused qt1050_resume(struct device *dev)
+static int qt1050_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct qt1050_priv *ts = i2c_get_clientdata(client);
@@ -574,7 +574,7 @@ static int __maybe_unused qt1050_resume(struct device *dev)
 	return regmap_write(ts->regmap, QT1050_LPMODE, 2);
 }
 
-static SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
 
 static const struct of_device_id __maybe_unused qt1050_of_match[] = {
 	{ .compatible = "microchip,qt1050", },
@@ -586,7 +586,7 @@ static struct i2c_driver qt1050_driver = {
 	.driver	= {
 		.name = "qt1050",
 		.of_match_table = of_match_ptr(qt1050_of_match),
-		.pm = &qt1050_pm_ops,
+		.pm = pm_sleep_ptr(&qt1050_pm_ops),
 	},
 	.probe_new = qt1050_probe,
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 11/32] Input: spear-keyboard - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (9 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 10/32] Input: qt1050 " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 12/32] Input: tm2-touchkey " Jonathan Cameron
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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/spear-keyboard.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 9838c79cb288..4bb7c533147c 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -284,7 +284,7 @@ static int spear_kbd_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused spear_kbd_suspend(struct device *dev)
+static int spear_kbd_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct spear_kbd *kbd = platform_get_drvdata(pdev);
@@ -337,7 +337,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused spear_kbd_resume(struct device *dev)
+static int spear_kbd_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct spear_kbd *kbd = platform_get_drvdata(pdev);
@@ -364,7 +364,8 @@ static int __maybe_unused spear_kbd_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops,
+				spear_kbd_suspend, spear_kbd_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id spear_kbd_id_table[] = {
@@ -379,7 +380,7 @@ static struct platform_driver spear_kbd_driver = {
 	.remove		= spear_kbd_remove,
 	.driver		= {
 		.name	= "keyboard",
-		.pm	= &spear_kbd_pm_ops,
+		.pm	= pm_sleep_ptr(&spear_kbd_pm_ops),
 		.of_match_table = of_match_ptr(spear_kbd_id_table),
 	},
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 12/32] Input: tm2-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (10 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 11/32] Input: spear-keyboard " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 13/32] Input: lm8323 " Jonathan Cameron
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Stephan Gerhold

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: Stephan Gerhold <stephan@gerhold.net>
---
 drivers/input/keyboard/tm2-touchkey.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
index 086aafaf0418..6627e65f06e5 100644
--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -297,7 +297,7 @@ static int tm2_touchkey_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused tm2_touchkey_suspend(struct device *dev)
+static int tm2_touchkey_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
@@ -308,7 +308,7 @@ static int __maybe_unused tm2_touchkey_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused tm2_touchkey_resume(struct device *dev)
+static int tm2_touchkey_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
@@ -323,8 +323,8 @@ static int __maybe_unused tm2_touchkey_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
-			 tm2_touchkey_suspend, tm2_touchkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
+				tm2_touchkey_suspend, tm2_touchkey_resume);
 
 static const struct i2c_device_id tm2_touchkey_id_table[] = {
 	{ TM2_TOUCHKEY_DEV_NAME, 0 },
@@ -353,7 +353,7 @@ MODULE_DEVICE_TABLE(of, tm2_touchkey_of_match);
 static struct i2c_driver tm2_touchkey_driver = {
 	.driver = {
 		.name = TM2_TOUCHKEY_DEV_NAME,
-		.pm = &tm2_touchkey_pm_ops,
+		.pm = pm_sleep_ptr(&tm2_touchkey_pm_ops),
 		.of_match_table = of_match_ptr(tm2_touchkey_of_match),
 	},
 	.probe_new = tm2_touchkey_probe,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 13/32] Input: lm8323 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (11 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 12/32] Input: tm2-touchkey " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 14/32] Input: lpc32xx-keys " Jonathan Cameron
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/lm8323.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
index 4846eccb0a93..5df4d5a7ed9e 100644
--- a/drivers/input/keyboard/lm8323.c
+++ b/drivers/input/keyboard/lm8323.c
@@ -770,7 +770,6 @@ static void lm8323_remove(struct i2c_client *client)
 	kfree(lm);
 }
 
-#ifdef CONFIG_PM_SLEEP
 /*
  * We don't need to explicitly suspend the chip, as it already switches off
  * when there's no activity.
@@ -814,9 +813,8 @@ static int lm8323_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
 
 static const struct i2c_device_id lm8323_id[] = {
 	{ "lm8323", 0 },
@@ -826,7 +824,7 @@ static const struct i2c_device_id lm8323_id[] = {
 static struct i2c_driver lm8323_i2c_driver = {
 	.driver = {
 		.name	= "lm8323",
-		.pm	= &lm8323_pm_ops,
+		.pm	= pm_sleep_ptr(&lm8323_pm_ops),
 	},
 	.probe_new	= lm8323_probe,
 	.remove		= lm8323_remove,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 14/32] Input: lpc32xx-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (12 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 13/32] Input: lm8323 " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 15/32] Input: matrix-keypad " Jonathan Cameron
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/lpc32xx-keys.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c
index 943aeeb0de79..911e1181cd6f 100644
--- a/drivers/input/keyboard/lpc32xx-keys.c
+++ b/drivers/input/keyboard/lpc32xx-keys.c
@@ -264,7 +264,6 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int lpc32xx_kscan_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -302,10 +301,9 @@ static int lpc32xx_kscan_resume(struct device *dev)
 	mutex_unlock(&input->mutex);
 	return retval;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(lpc32xx_kscan_pm_ops, lpc32xx_kscan_suspend,
-			 lpc32xx_kscan_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(lpc32xx_kscan_pm_ops, lpc32xx_kscan_suspend,
+				lpc32xx_kscan_resume);
 
 static const struct of_device_id lpc32xx_kscan_match[] = {
 	{ .compatible = "nxp,lpc3220-key" },
@@ -317,7 +315,7 @@ static struct platform_driver lpc32xx_kscan_driver = {
 	.probe		= lpc32xx_kscan_probe,
 	.driver		= {
 		.name	= DRV_NAME,
-		.pm	= &lpc32xx_kscan_pm_ops,
+		.pm	= pm_sleep_ptr(&lpc32xx_kscan_pm_ops),
 		.of_match_table = lpc32xx_kscan_match,
 	}
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 15/32] Input: matrix-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (13 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 14/32] Input: lpc32xx-keys " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 16/32] Input: max7359-keypad " Jonathan Cameron
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Marek Vasut

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
---
 drivers/input/keyboard/matrix_keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index b4c0325bbf1a..203310727d88 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -230,7 +230,6 @@ static void matrix_keypad_stop(struct input_dev *dev)
 	disable_row_irqs(keypad);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static void matrix_keypad_enable_wakeup(struct matrix_keypad *keypad)
 {
 	const struct matrix_keypad_platform_data *pdata = keypad->pdata;
@@ -299,10 +298,9 @@ static int matrix_keypad_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
-			 matrix_keypad_suspend, matrix_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
+				matrix_keypad_suspend, matrix_keypad_resume);
 
 static int matrix_keypad_init_gpio(struct platform_device *pdev,
 				   struct matrix_keypad *keypad)
@@ -577,7 +575,7 @@ static struct platform_driver matrix_keypad_driver = {
 	.remove		= matrix_keypad_remove,
 	.driver		= {
 		.name	= "matrix-keypad",
-		.pm	= &matrix_keypad_pm_ops,
+		.pm	= pm_sleep_ptr(&matrix_keypad_pm_ops),
 		.of_match_table = of_match_ptr(matrix_keypad_dt_match),
 	},
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 16/32] Input: max7359-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (14 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 15/32] Input: matrix-keypad " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 17/32] Input: mcs-touchkey " Jonathan Cameron
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/max7359_keypad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c
index 1bba11ed4132..b363749d02e2 100644
--- a/drivers/input/keyboard/max7359_keypad.c
+++ b/drivers/input/keyboard/max7359_keypad.c
@@ -242,7 +242,6 @@ static int max7359_probe(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max7359_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -267,9 +266,8 @@ static int max7359_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);
 
 static const struct i2c_device_id max7359_ids[] = {
 	{ "max7359", 0 },
@@ -280,7 +278,7 @@ MODULE_DEVICE_TABLE(i2c, max7359_ids);
 static struct i2c_driver max7359_i2c_driver = {
 	.driver = {
 		.name = "max7359",
-		.pm   = &max7359_pm,
+		.pm   = pm_sleep_ptr(&max7359_pm),
 	},
 	.probe_new	= max7359_probe,
 	.id_table	= max7359_ids,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 17/32] Input: mcs-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (15 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 16/32] Input: max7359-keypad " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 18/32] Input: nomadik-ske-keypad " Jonathan Cameron
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/mcs_touchkey.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c
index 34683458524c..d414e19e4559 100644
--- a/drivers/input/keyboard/mcs_touchkey.c
+++ b/drivers/input/keyboard/mcs_touchkey.c
@@ -213,7 +213,6 @@ static void mcs_touchkey_shutdown(struct i2c_client *client)
 		data->poweron(false);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mcs_touchkey_suspend(struct device *dev)
 {
 	struct mcs_touchkey_data *data = dev_get_drvdata(dev);
@@ -243,10 +242,9 @@ static int mcs_touchkey_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(mcs_touchkey_pm_ops,
-			 mcs_touchkey_suspend, mcs_touchkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mcs_touchkey_pm_ops,
+				mcs_touchkey_suspend, mcs_touchkey_resume);
 
 static const struct i2c_device_id mcs_touchkey_id[] = {
 	{ "mcs5000_touchkey", MCS5000_TOUCHKEY },
@@ -258,7 +256,7 @@ MODULE_DEVICE_TABLE(i2c, mcs_touchkey_id);
 static struct i2c_driver mcs_touchkey_driver = {
 	.driver = {
 		.name	= "mcs_touchkey",
-		.pm	= &mcs_touchkey_pm_ops,
+		.pm	= pm_sleep_ptr(&mcs_touchkey_pm_ops),
 	},
 	.probe_new	= mcs_touchkey_probe,
 	.remove		= mcs_touchkey_remove,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 18/32] Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (16 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 17/32] Input: mcs-touchkey " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-06 23:43   ` Linus Walleij
  2022-12-04 18:08 ` [PATCH 19/32] Input: pmic8xxx-keypad " Jonathan Cameron
                   ` (14 subsequent siblings)
  32 siblings, 1 reply; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Linus Walleij

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/input/keyboard/nomadik-ske-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 0d55a95347f1..970f2a671c2e 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -388,7 +388,6 @@ static int ske_keypad_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int ske_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -416,15 +415,14 @@ static int ske_keypad_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
-			 ske_keypad_suspend, ske_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
+				ske_keypad_suspend, ske_keypad_resume);
 
 static struct platform_driver ske_keypad_driver = {
 	.driver = {
 		.name = "nmk-ske-keypad",
-		.pm = &ske_keypad_dev_pm_ops,
+		.pm = pm_sleep_ptr(&ske_keypad_dev_pm_ops),
 	},
 	.remove = ske_keypad_remove,
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 19/32] Input: pmic8xxx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (17 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 18/32] Input: nomadik-ske-keypad " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 20/32] Input: pxa27x_keypad " Jonathan Cameron
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/pmic8xxx-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c
index 4766c5048ce2..26a005f9ace3 100644
--- a/drivers/input/keyboard/pmic8xxx-keypad.c
+++ b/drivers/input/keyboard/pmic8xxx-keypad.c
@@ -621,7 +621,6 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int pmic8xxx_kp_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -661,10 +660,9 @@ static int pmic8xxx_kp_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
-			 pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
+				pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
 
 static const struct of_device_id pm8xxx_match_table[] = {
 	{ .compatible = "qcom,pm8058-keypad" },
@@ -677,7 +675,7 @@ static struct platform_driver pmic8xxx_kp_driver = {
 	.probe		= pmic8xxx_kp_probe,
 	.driver		= {
 		.name = "pm8xxx-keypad",
-		.pm = &pm8xxx_kp_pm_ops,
+		.pm = pm_sleep_ptr(&pm8xxx_kp_pm_ops),
 		.of_match_table = pm8xxx_match_table,
 	},
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 20/32] Input: pxa27x_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (18 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 19/32] Input: pmic8xxx-keypad " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 21/32] Input: qt1070 " Jonathan Cameron
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/pxa27x_keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index a7f8257c8a02..871f858d0ba7 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -660,7 +660,6 @@ static void pxa27x_keypad_close(struct input_dev *dev)
 	clk_disable_unprepare(keypad->clk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int pxa27x_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -706,10 +705,9 @@ static int pxa27x_keypad_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
-			 pxa27x_keypad_suspend, pxa27x_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
+				pxa27x_keypad_suspend, pxa27x_keypad_resume);
 
 
 static int pxa27x_keypad_probe(struct platform_device *pdev)
@@ -830,7 +828,7 @@ static struct platform_driver pxa27x_keypad_driver = {
 	.driver		= {
 		.name	= "pxa27x-keypad",
 		.of_match_table = of_match_ptr(pxa27x_keypad_dt_match),
-		.pm	= &pxa27x_keypad_pm_ops,
+		.pm	= pm_sleep_ptr(&pxa27x_keypad_pm_ops),
 	},
 };
 module_platform_driver(pxa27x_keypad_driver);
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 21/32] Input: qt1070 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (19 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 20/32] Input: pxa27x_keypad " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 22/32] Input: sh-keysc " Jonathan Cameron
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/qt1070.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
index 533bb0375223..fabb50bde844 100644
--- a/drivers/input/keyboard/qt1070.c
+++ b/drivers/input/keyboard/qt1070.c
@@ -226,7 +226,6 @@ static void qt1070_remove(struct i2c_client *client)
 	kfree(data);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int qt1070_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -248,9 +247,8 @@ static int qt1070_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
 
 static const struct i2c_device_id qt1070_id[] = {
 	{ "qt1070", 0 },
@@ -270,7 +268,7 @@ static struct i2c_driver qt1070_driver = {
 	.driver	= {
 		.name	= "qt1070",
 		.of_match_table = of_match_ptr(qt1070_of_match),
-		.pm	= &qt1070_pm_ops,
+		.pm	= pm_sleep_ptr(&qt1070_pm_ops),
 	},
 	.id_table	= qt1070_id,
 	.probe_new	= qt1070_probe,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 22/32] Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (20 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 21/32] Input: qt1070 " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 23/32] Input: st-keyscan " Jonathan Cameron
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/sh_keysc.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index c155adebf96e..2c00320f739f 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -283,7 +283,6 @@ static int sh_keysc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sh_keysc_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -316,17 +315,16 @@ static int sh_keysc_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
-			 sh_keysc_suspend, sh_keysc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
+				sh_keysc_suspend, sh_keysc_resume);
 
 static struct platform_driver sh_keysc_device_driver = {
 	.probe		= sh_keysc_probe,
 	.remove		= sh_keysc_remove,
 	.driver		= {
 		.name	= "sh_keysc",
-		.pm	= &sh_keysc_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&sh_keysc_dev_pm_ops),
 	}
 };
 module_platform_driver(sh_keysc_device_driver);
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 23/32] Input: st-keyscan - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (21 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 22/32] Input: sh-keysc " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 24/32] Input: tc3589x " Jonathan Cameron
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/st-keyscan.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
index a62bb8fff88c..13735a5e8391 100644
--- a/drivers/input/keyboard/st-keyscan.c
+++ b/drivers/input/keyboard/st-keyscan.c
@@ -212,7 +212,6 @@ static int keyscan_probe(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int keyscan_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -247,9 +246,9 @@ static int keyscan_resume(struct device *dev)
 	mutex_unlock(&input->mutex);
 	return retval;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, keyscan_suspend, keyscan_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops,
+				keyscan_suspend, keyscan_resume);
 
 static const struct of_device_id keyscan_of_match[] = {
 	{ .compatible = "st,sti-keyscan" },
@@ -261,7 +260,7 @@ static struct platform_driver keyscan_device_driver = {
 	.probe		= keyscan_probe,
 	.driver		= {
 		.name	= "st-keyscan",
-		.pm	= &keyscan_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&keyscan_dev_pm_ops),
 		.of_match_table = of_match_ptr(keyscan_of_match),
 	}
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 24/32] Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (22 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 23/32] Input: st-keyscan " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 25/32] Input: tca6416-keypad " Jonathan Cameron
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/tc3589x-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c
index 78e55318ccd6..b0d86621c60a 100644
--- a/drivers/input/keyboard/tc3589x-keypad.c
+++ b/drivers/input/keyboard/tc3589x-keypad.c
@@ -455,7 +455,6 @@ static int tc3589x_keypad_probe(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tc3589x_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -492,15 +491,14 @@ static int tc3589x_keypad_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops,
-			 tc3589x_keypad_suspend, tc3589x_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops,
+				tc3589x_keypad_suspend, tc3589x_keypad_resume);
 
 static struct platform_driver tc3589x_keypad_driver = {
 	.driver	= {
 		.name	= "tc3589x-keypad",
-		.pm	= &tc3589x_keypad_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&tc3589x_keypad_dev_pm_ops),
 	},
 	.probe	= tc3589x_keypad_probe,
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 25/32] Input: tca6416-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (23 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 24/32] Input: tc3589x " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 26/32] Input: tegra-kbc " Jonathan Cameron
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Linus Walleij

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/input/keyboard/tca6416-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c
index 281d9ec163cc..673b905af6fe 100644
--- a/drivers/input/keyboard/tca6416-keypad.c
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -320,7 +320,6 @@ static void tca6416_keypad_remove(struct i2c_client *client)
 	kfree(chip);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tca6416_keypad_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -342,15 +341,14 @@ static int tca6416_keypad_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
-			 tca6416_keypad_suspend, tca6416_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
+				tca6416_keypad_suspend, tca6416_keypad_resume);
 
 static struct i2c_driver tca6416_keypad_driver = {
 	.driver = {
 		.name	= "tca6416-keypad",
-		.pm	= &tca6416_keypad_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&tca6416_keypad_dev_pm_ops),
 	},
 	.probe_new	= tca6416_keypad_probe,
 	.remove		= tca6416_keypad_remove,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 26/32] Input: tegra-kbc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (24 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 25/32] Input: tca6416-keypad " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 27/32] Input: tegra-kbc - allow build with COMPILE_TEST Jonathan Cameron
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

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 ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/tegra-kbc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 570fe18c0ce9..1eba06bcf27a 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -713,7 +713,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static void tegra_kbc_set_keypress_interrupt(struct tegra_kbc *kbc, bool enable)
 {
 	u32 val;
@@ -802,15 +801,15 @@ static int tegra_kbc_resume(struct device *dev)
 
 	return err;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops, tegra_kbc_suspend, tegra_kbc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops,
+				tegra_kbc_suspend, tegra_kbc_resume);
 
 static struct platform_driver tegra_kbc_driver = {
 	.probe		= tegra_kbc_probe,
 	.driver	= {
 		.name	= "tegra-kbc",
-		.pm	= &tegra_kbc_pm_ops,
+		.pm	= pm_sleep_ptr(&tegra_kbc_pm_ops),
 		.of_match_table = tegra_kbc_of_match,
 	},
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 27/32] Input: tegra-kbc - allow build with COMPILE_TEST
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (25 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 26/32] Input: tegra-kbc " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 28/32] Input: spear-keyboard - improve build coverage using COMPILE_TEST Jonathan Cameron
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Used to build test PM changes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 00292118b79b..28a9ad8a1466 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -508,7 +508,7 @@ config KEYBOARD_NSPIRE
 
 config KEYBOARD_TEGRA
 	tristate "NVIDIA Tegra internal matrix keyboard controller support"
-	depends on ARCH_TEGRA && OF
+	depends on (ARCH_TEGRA && OF) || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use a matrix keyboard connected directly
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 28/32] Input: spear-keyboard - improve build coverage using COMPILE_TEST
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (26 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 27/32] Input: tegra-kbc - allow build with COMPILE_TEST Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 29/32] Input: pxa27xx-keypad - allow build with COMPILE_TEST Jonathan Cameron
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Used to test the PM changes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 28a9ad8a1466..39717a2e1757 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -709,7 +709,7 @@ config KEYBOARD_OMAP4
 
 config KEYBOARD_SPEAR
 	tristate "ST SPEAR keyboard support"
-	depends on PLAT_SPEAR
+	depends on PLAT_SPEAR || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use the SPEAR keyboard.
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 29/32] Input: pxa27xx-keypad - allow build with COMPILE_TEST
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (27 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 28/32] Input: spear-keyboard - improve build coverage using COMPILE_TEST Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 30/32] Input: nomadik-ske-keypad - allow building " Jonathan Cameron
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Used to build test PM changes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 39717a2e1757..1a949445f116 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -542,7 +542,7 @@ config KEYBOARD_PINEPHONE
 
 config KEYBOARD_PXA27x
 	tristate "PXA27x/PXA3xx keypad support"
-	depends on PXA27x || PXA3xx || ARCH_MMP
+	depends on PXA27x || PXA3xx || ARCH_MMP || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Enable support for PXA27x/PXA3xx keypad controller.
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 30/32] Input: nomadik-ske-keypad - allow building with COMPILE_TEST
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (28 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 29/32] Input: pxa27xx-keypad - allow build with COMPILE_TEST Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-04 18:08 ` [PATCH 31/32] Input: lpc32xx " Jonathan Cameron
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Used to build test the PM changes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 1a949445f116..3f232d727e31 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -487,7 +487,7 @@ config KEYBOARD_NEWTON
 
 config KEYBOARD_NOMADIK
 	tristate "ST-Ericsson Nomadik SKE keyboard"
-	depends on (ARCH_NOMADIK || ARCH_U8500)
+	depends on (ARCH_NOMADIK || ARCH_U8500 || COMPILE_TEST)
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use a keypad provided on the SKE controller
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 31/32] Input: lpc32xx - allow building with COMPILE_TEST
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (29 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 30/32] Input: nomadik-ske-keypad - allow building " Jonathan Cameron
@ 2022-12-04 18:08 ` 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
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Used to test the PM changes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 3f232d727e31..84490915ae4d 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -390,7 +390,7 @@ config KEYBOARD_LOCOMO
 
 config KEYBOARD_LPC32XX
 	tristate "LPC32XX matrix key scanner support"
-	depends on ARCH_LPC32XX && OF
+	depends on (ARCH_LPC32XX && OF) || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use NXP LPC32XX SoC key scanner interface,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 32/32] Input: pxspad: Fix unused data warning when force feedback not enabled.
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (30 preceding siblings ...)
  2022-12-04 18:08 ` [PATCH 31/32] Input: lpc32xx " Jonathan Cameron
@ 2022-12-04 18:08 ` Jonathan Cameron
  2022-12-07 21:47 ` [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Dmitry Torokhov
  32 siblings, 0 replies; 39+ messages in thread
From: Jonathan Cameron @ 2022-12-04 18:08 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Tomohiro Yoshidomi

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

The functions using this data were protected with
Do the same for the data used only in those functions.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomohiro Yoshidomi <sylph23k@gmail.com>
---
 drivers/input/joystick/psxpad-spi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c
index 2c395af13d42..de734a927b4d 100644
--- a/drivers/input/joystick/psxpad-spi.c
+++ b/drivers/input/joystick/psxpad-spi.c
@@ -44,6 +44,8 @@ static const u8 PSX_CMD_POLL[] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
+
+#ifdef CONFIG_JOYSTICK_PSXPAD_SPI_FF
 /*	0x01, 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 */
 static const u8 PSX_CMD_ENTER_CFG[] = {
 	0x80, 0xC2, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
@@ -56,6 +58,7 @@ static const u8 PSX_CMD_EXIT_CFG[] = {
 static const u8 PSX_CMD_ENABLE_MOTOR[]	= {
 	0x80, 0xB2, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF
 };
+#endif /* CONFIG_JOYSTICK_PSXPAD_SPI_FF */
 
 struct psxpad {
 	struct spi_device *spi;
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [PATCH 10/32] Input: qt1050 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 ` [PATCH 10/32] Input: qt1050 " Jonathan Cameron
@ 2022-12-05  8:59   ` Marco Felsch
  0 siblings, 0 replies; 39+ messages in thread
From: Marco Felsch @ 2022-12-05  8:59 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron

Hi Jonathan,

thanks for the patch.

On 22-12-04, Jonathan Cameron wrote:
> 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>

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

> Cc: Marco Felsch <m.felsch@pengutronix.de>
> ---
>  drivers/input/keyboard/qt1050.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c
> index 403060d05c3b..317fe2b1f827 100644
> --- a/drivers/input/keyboard/qt1050.c
> +++ b/drivers/input/keyboard/qt1050.c
> @@ -547,7 +547,7 @@ static int qt1050_probe(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static int __maybe_unused qt1050_suspend(struct device *dev)
> +static int qt1050_suspend(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	struct qt1050_priv *ts = i2c_get_clientdata(client);
> @@ -563,7 +563,7 @@ static int __maybe_unused qt1050_suspend(struct device *dev)
>  			    device_may_wakeup(dev) ? 125 : 0);
>  }
>  
> -static int __maybe_unused qt1050_resume(struct device *dev)
> +static int qt1050_resume(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	struct qt1050_priv *ts = i2c_get_clientdata(client);
> @@ -574,7 +574,7 @@ static int __maybe_unused qt1050_resume(struct device *dev)
>  	return regmap_write(ts->regmap, QT1050_LPMODE, 2);
>  }
>  
> -static SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
>  
>  static const struct of_device_id __maybe_unused qt1050_of_match[] = {
>  	{ .compatible = "microchip,qt1050", },
> @@ -586,7 +586,7 @@ static struct i2c_driver qt1050_driver = {
>  	.driver	= {
>  		.name = "qt1050",
>  		.of_match_table = of_match_ptr(qt1050_of_match),
> -		.pm = &qt1050_pm_ops,
> +		.pm = pm_sleep_ptr(&qt1050_pm_ops),
>  	},
>  	.probe_new = qt1050_probe,
>  };
> -- 
> 2.38.1
> 
> 

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 09/32] Input: mtk-pmic-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 ` [PATCH 09/32] Input: mtk-pmic-keys " Jonathan Cameron
@ 2022-12-05 13:23   ` Mattijs Korpershoek
  0 siblings, 0 replies; 39+ messages in thread
From: Mattijs Korpershoek @ 2022-12-05 13:23 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

On Sun, Dec 04, 2022 at 18:08, Jonathan Cameron <jic23@kernel.org> wrote:

> 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: Mattijs Korpershoek <mkorpershoek@baylibre.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/input/keyboard/mtk-pmic-keys.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
> index 9b34da0ec260..3d4ffa25e3df 100644
> --- a/drivers/input/keyboard/mtk-pmic-keys.c
> +++ b/drivers/input/keyboard/mtk-pmic-keys.c
> @@ -231,7 +231,7 @@ static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys,
>  	return 0;
>  }
>  
> -static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
> +static int mtk_pmic_keys_suspend(struct device *dev)
>  {
>  	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
>  	int index;
> @@ -247,7 +247,7 @@ static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
> +static int mtk_pmic_keys_resume(struct device *dev)
>  {
>  	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
>  	int index;
> @@ -263,8 +263,8 @@ static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
> -			mtk_pmic_keys_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
> +				mtk_pmic_keys_resume);
>  
>  static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
>  	{
> @@ -387,7 +387,7 @@ static struct platform_driver pmic_keys_pdrv = {
>  	.driver = {
>  		   .name = "mtk-pmic-keys",
>  		   .of_match_table = of_mtk_pmic_keys_match_tbl,
> -		   .pm = &mtk_pmic_keys_pm_ops,
> +		   .pm = pm_sleep_ptr(&mtk_pmic_keys_pm_ops),
>  	},
>  };
>  
> -- 
> 2.38.1

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 07/32] Input: ipaq-micro-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 ` [PATCH 07/32] Input: ipaq-micro-keys " Jonathan Cameron
@ 2022-12-06 23:43   ` Linus Walleij
  0 siblings, 0 replies; 39+ messages in thread
From: Linus Walleij @ 2022-12-06 23:43 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron

On Sun, Dec 4, 2022 at 6:56 PM Jonathan Cameron <jic23@kernel.org> wrote:

> 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: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 18/32] Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 ` [PATCH 18/32] Input: nomadik-ske-keypad " Jonathan Cameron
@ 2022-12-06 23:43   ` Linus Walleij
  0 siblings, 0 replies; 39+ messages in thread
From: Linus Walleij @ 2022-12-06 23:43 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron

On Sun, Dec 4, 2022 at 6:56 PM Jonathan Cameron <jic23@kernel.org> wrote:

> 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 ifdef guards.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 03/32] Input: cros-ec-keyb - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2022-12-04 18:08 ` [PATCH 03/32] Input: cros-ec-keyb " Jonathan Cameron
@ 2022-12-07  0:41   ` Stephen Boyd
  0 siblings, 0 replies; 39+ messages in thread
From: Stephen Boyd @ 2022-12-07  0:41 UTC (permalink / raw)
  To: Dmitry Torokhov, Jonathan Cameron, linux-input; +Cc: Jonathan Cameron

Quoting Jonathan Cameron (2022-12-04 10:08:12)
> 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>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS()
  2022-12-04 18:08 [PATCH 00/32] Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS() Jonathan Cameron
                   ` (31 preceding siblings ...)
  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 ` Dmitry Torokhov
  32 siblings, 0 replies; 39+ messages in thread
From: Dmitry Torokhov @ 2022-12-07 21:47 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-input, Jonathan Cameron, Paul Cercueil, Tomohiro Yoshidomi,
	Michael Hennerich, Stephen Boyd, Yassine Oudjana, Linus Walleij,
	Michal Vokáč,
	Mattijs Korpershoek, Marco Felsch, Stephan Gerhold, Marek Vasut

On Sun, Dec 04, 2022 at 06:08:09PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> As part of recent changes to the macros in linux/pm.h, the
> SIMPLE_DEV_PM_OPS() macro is deprecated in favor of the comination
> of DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().
> More details in the relevant commit message.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1a3c7bb088266fa2db017be299f91f1c1894c857
> 
> The main advantage of the new versions is that they allow the compiler
> to 'see' the callbacks registered, thus avoiding the need to either
> protect them with ifdef guards or to mark them __maybe_unused.
> The compiler then removes the structure and the callbacks as dead code
> in event of !CONFIG_PM_SLEEP.
> 
> Ultimately to clean up the old macros the change needs to be done to
> all instances of the SIMPLE_DEV_PM_OPS() in the kernel. There are similar
> changes to be done for runtime PM macros and more complex PM handling.
> This set is just meant to switch over some of the low hanging fruit in
> a bite sized chunk.
> 
> Also included at the end of this series are:
> * a warning fix for pxspad
> * allowing various drivers to be build with CONFIG_COMPILE_TEST.
> 
> There was one case that really is architecture specific for which I
> did only a partial build test.  I pushed these out in a branch that
> 0-day build and it didn't see any problems.

Applied the lot, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2022-12-07 21:47 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [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

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).