All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2
@ 2023-01-02 18:17 Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 01/69] Input: 88pm860x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Jonathan Cameron
                   ` (70 more replies)
  0 siblings, 71 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Paul Cercueil, Roy Im, Moritz Fischer,
	Luca Weiss, Jeff LaBundy, Krzysztof Kozlowski,
	Geert Uytterhoeven, Stephen Boyd, Damien Riegel,
	Lars-Peter Clausen, Pascal Paillet, Tony Lindgren, Raul E Rangel,
	Hans de Goede, Michael Hennerich, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Heiko Stuebner, Linus Walleij,
	Zhu Yi, Mark Jonas, Michael Trimarchi, Dario Binacchi,
	Daniel Mack, Jonathan Neuschäfer, Douglas Anderson,
	Bastien Nocera, Anthony Kim, Joe Hung, Markuss Broks, Haibo Chen,
	Sangwon Jee, Vincent Knecht, Fabio Estevam, John Keeping,
	Stephen Just, Benjamin Tissoires, Dario Binacchi,
	Alistair Francis

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

This 2nd set is a continuation from:
https://lore.kernel.org/all/20221204180841.2211588-1-jic23@kernel.org/

A 3rd set (maybe more than one) will cover the remaining more
complex cases in Input that go beyond a straight forward switch.
Those will need more careful review than this (hopefully) simple
set.

As part of recent changes to the macros in linux/pm.h, the
SIMPLE_DEV_PM_OPS() macro is deprecated in favor of the combination
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.

Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Roy Im <roy.im.opensource@diasemi.com>
Cc: Moritz Fischer <mdf@kernel.org>
Cc: Luca Weiss <luca@z3ntu.xyz>
Cc: Jeff LaBundy <jeff@labundy.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Stephen Boyd <swboyd@chromium.org>
Cc: Damien Riegel <damien.riegel@savoirfairelinux.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Pascal Paillet <p.paillet@st.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Raul E Rangel <rrangel@chromium.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Zhu Yi <yi.zhu5@cn.bosch.com>
Cc: Mark Jonas <mark.jonas@de.bosch.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Daniel Mack <daniel@zonque.org>
Cc: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Bastien Nocera <hadess@hadess.net>
Cc: Anthony Kim <anthony.kim@hideep.com>
Cc: Joe Hung <joe_hung@ilitek.com>
Cc: Markuss Broks <markuss.broks@gmail.com>
Cc: Haibo Chen <haibo.chen@nxp.com>
Cc: Sangwon Jee <jeesw@melfas.com>
Cc: Vincent Knecht <vincent.knecht@mailoo.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: John Keeping <john@metanate.com>
Cc: Stephen Just <stephenjust@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Dario Binacchi <dariobin@libero.it>
Cc: Alistair Francis <alistair@alistair23.me>

Jonathan Cameron (69):
  Input: 88pm860x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: da7280 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: drv260x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: drv2665 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: drv2667 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: e3x0-button - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: gpio-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: iqs269a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: iqs626a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: kxtj9 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: max77693-haptic - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: max8925_onkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: max8997_haptic - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: palmas-pwrbutton - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pcfg8574_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pm8941-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pm8xxx-vibrator - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pmic8xxx-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pwm-beeper - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pwm-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: regulator-haptic - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: rotary-encoder - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: stpmic1_onekey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: twl4030-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: twl6030-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: elan_i2c_core - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: navpoint - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: synaptics_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ambakmi - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ad7877 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ads7846 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ar1021 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: atmel_mxt_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: auo-pixcir-ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: bu21013_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: bu21029 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: chipone_in8318 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: chipone_icn8505 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: cy8ctma140 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: cy8ctmg110_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: edt-ft5x06 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: eeti_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: egalax_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  input: ektf2127 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: elants_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: goodix - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: hideep - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ilitek_ts_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: imagis - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: imx6ul_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: iqs5xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mcs5000_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: melfas_mip4 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  input: migor_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mms114 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: msg2638 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pixcir_i2c_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: raydium_i2c_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: silead - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: st1232 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: surface3_spi - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ti_am335x_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ucb1400_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: wacom_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: wdt87xx_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: wm97xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: zforce_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: zinitix - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ipaq-micro-ts - use DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()

 drivers/input/misc/88pm860x_onkey.c         |  9 +++++----
 drivers/input/misc/da7280.c                 |  8 ++++----
 drivers/input/misc/drv260x.c                |  8 ++++----
 drivers/input/misc/drv2665.c                |  8 ++++----
 drivers/input/misc/drv2667.c                |  8 ++++----
 drivers/input/misc/e3x0-button.c            | 10 +++++-----
 drivers/input/misc/gpio-vibra.c             | 10 +++++-----
 drivers/input/misc/iqs269a.c                |  8 ++++----
 drivers/input/misc/iqs626a.c                |  8 ++++----
 drivers/input/misc/kxtj9.c                  |  8 ++++----
 drivers/input/misc/max77693-haptic.c        | 11 ++++++-----
 drivers/input/misc/max8925_onkey.c          |  9 +++++----
 drivers/input/misc/max8997_haptic.c         |  7 ++++---
 drivers/input/misc/palmas-pwrbutton.c       | 10 +++++-----
 drivers/input/misc/pcf8574_keypad.c         | 16 +++-------------
 drivers/input/misc/pm8941-pwrkey.c          | 10 +++++-----
 drivers/input/misc/pm8xxx-vibrator.c        |  6 +++---
 drivers/input/misc/pmic8xxx-pwrkey.c        |  8 ++++----
 drivers/input/misc/pwm-beeper.c             | 10 +++++-----
 drivers/input/misc/pwm-vibra.c              | 10 +++++-----
 drivers/input/misc/regulator-haptic.c       |  8 ++++----
 drivers/input/misc/rotary_encoder.c         | 10 +++++-----
 drivers/input/misc/stpmic1_onkey.c          | 12 ++++++------
 drivers/input/misc/twl4030-vibra.c          | 10 +++++-----
 drivers/input/misc/twl6040-vibra.c          |  7 ++++---
 drivers/input/mouse/elan_i2c_core.c         |  8 ++++----
 drivers/input/mouse/navpoint.c              |  9 +++++----
 drivers/input/mouse/synaptics_i2c.c         | 10 +++++-----
 drivers/input/serio/ambakmi.c               |  6 +++---
 drivers/input/touchscreen/ad7877.c          |  8 ++++----
 drivers/input/touchscreen/ads7846.c         |  8 ++++----
 drivers/input/touchscreen/ar1021_i2c.c      |  9 +++++----
 drivers/input/touchscreen/atmel_mxt_ts.c    |  8 ++++----
 drivers/input/touchscreen/auo-pixcir-ts.c   | 10 +++++-----
 drivers/input/touchscreen/bu21013_ts.c      |  8 ++++----
 drivers/input/touchscreen/bu21029_ts.c      |  8 ++++----
 drivers/input/touchscreen/chipone_icn8318.c |  6 ++----
 drivers/input/touchscreen/chipone_icn8505.c |  8 ++++----
 drivers/input/touchscreen/cy8ctma140.c      |  9 +++++----
 drivers/input/touchscreen/cy8ctmg110_ts.c   |  9 +++++----
 drivers/input/touchscreen/edt-ft5x06.c      | 10 +++++-----
 drivers/input/touchscreen/eeti_ts.c         |  8 ++++----
 drivers/input/touchscreen/egalax_ts.c       |  9 +++++----
 drivers/input/touchscreen/ektf2127.c        | 10 +++++-----
 drivers/input/touchscreen/elants_i2c.c      | 10 +++++-----
 drivers/input/touchscreen/goodix.c          |  8 ++++----
 drivers/input/touchscreen/hideep.c          |  8 ++++----
 drivers/input/touchscreen/ilitek_ts_i2c.c   |  8 ++++----
 drivers/input/touchscreen/imagis.c          |  8 ++++----
 drivers/input/touchscreen/imx6ul_tsc.c      | 10 +++++-----
 drivers/input/touchscreen/ipaq-micro-ts.c   | 11 +++++------
 drivers/input/touchscreen/iqs5xx.c          |  8 ++++----
 drivers/input/touchscreen/mcs5000_ts.c      |  9 +++++----
 drivers/input/touchscreen/melfas_mip4.c     |  8 ++++----
 drivers/input/touchscreen/migor_ts.c        |  8 ++++----
 drivers/input/touchscreen/mms114.c          |  8 ++++----
 drivers/input/touchscreen/msg2638.c         |  8 ++++----
 drivers/input/touchscreen/pixcir_i2c_ts.c   | 10 +++++-----
 drivers/input/touchscreen/raydium_i2c_ts.c  | 12 ++++++------
 drivers/input/touchscreen/silead.c          |  8 ++++----
 drivers/input/touchscreen/st1232.c          | 10 +++++-----
 drivers/input/touchscreen/surface3_spi.c    | 12 ++++++------
 drivers/input/touchscreen/ti_am335x_tsc.c   |  8 ++++----
 drivers/input/touchscreen/ucb1400_ts.c      | 10 +++++-----
 drivers/input/touchscreen/wacom_i2c.c       |  8 ++++----
 drivers/input/touchscreen/wdt87xx_i2c.c     |  8 ++++----
 drivers/input/touchscreen/wm97xx-core.c     | 10 +++++-----
 drivers/input/touchscreen/zforce_ts.c       |  8 ++++----
 drivers/input/touchscreen/zinitix.c         |  8 ++++----
 69 files changed, 306 insertions(+), 308 deletions(-)

-- 
2.39.0


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

* [PATCH 01/69] Input: 88pm860x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 02/69] Input: da7280 " Jonathan Cameron
                   ` (69 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/88pm860x_onkey.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c
index 685995cad73f..0f8b7ffb3aff 100644
--- a/drivers/input/misc/88pm860x_onkey.c
+++ b/drivers/input/misc/88pm860x_onkey.c
@@ -110,7 +110,7 @@ static int pm860x_onkey_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused pm860x_onkey_suspend(struct device *dev)
+static int pm860x_onkey_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
@@ -119,7 +119,7 @@ static int __maybe_unused pm860x_onkey_suspend(struct device *dev)
 		chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY;
 	return 0;
 }
-static int __maybe_unused pm860x_onkey_resume(struct device *dev)
+static int pm860x_onkey_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
@@ -129,12 +129,13 @@ static int __maybe_unused pm860x_onkey_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops,
+				pm860x_onkey_suspend, pm860x_onkey_resume);
 
 static struct platform_driver pm860x_onkey_driver = {
 	.driver		= {
 		.name	= "88pm860x-onkey",
-		.pm	= &pm860x_onkey_pm_ops,
+		.pm	= pm_sleep_ptr(&pm860x_onkey_pm_ops),
 	},
 	.probe		= pm860x_onkey_probe,
 };
-- 
2.39.0


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

* [PATCH 02/69] Input: da7280 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 01/69] Input: 88pm860x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 03/69] Input: drv260x " Jonathan Cameron
                   ` (68 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Roy Im

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: Roy Im <roy.im.opensource@diasemi.com>
---
 drivers/input/misc/da7280.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
index dcdea33b1a8f..b85a19e3554f 100644
--- a/drivers/input/misc/da7280.c
+++ b/drivers/input/misc/da7280.c
@@ -1260,7 +1260,7 @@ static int da7280_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused da7280_suspend(struct device *dev)
+static int da7280_suspend(struct device *dev)
 {
 	struct da7280_haptic *haptics = dev_get_drvdata(dev);
 
@@ -1281,7 +1281,7 @@ static int __maybe_unused da7280_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused da7280_resume(struct device *dev)
+static int da7280_resume(struct device *dev)
 {
 	struct da7280_haptic *haptics = dev_get_drvdata(dev);
 	int retval;
@@ -1313,13 +1313,13 @@ static const struct i2c_device_id da7280_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, da7280_i2c_id);
 
-static SIMPLE_DEV_PM_OPS(da7280_pm_ops, da7280_suspend, da7280_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(da7280_pm_ops, da7280_suspend, da7280_resume);
 
 static struct i2c_driver da7280_driver = {
 	.driver = {
 		.name = "da7280",
 		.of_match_table = of_match_ptr(da7280_of_match),
-		.pm = &da7280_pm_ops,
+		.pm = pm_sleep_ptr(&da7280_pm_ops),
 	},
 	.probe_new = da7280_probe,
 	.id_table = da7280_i2c_id,
-- 
2.39.0


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

* [PATCH 03/69] Input: drv260x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 01/69] Input: 88pm860x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 02/69] Input: da7280 " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 04/69] Input: drv2665 " Jonathan Cameron
                   ` (67 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/drv260x.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
index 3a51ee5e935a..8a9ebfc04a2d 100644
--- a/drivers/input/misc/drv260x.c
+++ b/drivers/input/misc/drv260x.c
@@ -572,7 +572,7 @@ static int drv260x_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused drv260x_suspend(struct device *dev)
+static int drv260x_suspend(struct device *dev)
 {
 	struct drv260x_data *haptics = dev_get_drvdata(dev);
 	int ret = 0;
@@ -604,7 +604,7 @@ static int __maybe_unused drv260x_suspend(struct device *dev)
 	return ret;
 }
 
-static int __maybe_unused drv260x_resume(struct device *dev)
+static int drv260x_resume(struct device *dev)
 {
 	struct drv260x_data *haptics = dev_get_drvdata(dev);
 	int ret = 0;
@@ -635,7 +635,7 @@ static int __maybe_unused drv260x_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(drv260x_pm_ops, drv260x_suspend, drv260x_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(drv260x_pm_ops, drv260x_suspend, drv260x_resume);
 
 static const struct i2c_device_id drv260x_id[] = {
 	{ "drv2605l", 0 },
@@ -657,7 +657,7 @@ static struct i2c_driver drv260x_driver = {
 	.driver		= {
 		.name	= "drv260x-haptics",
 		.of_match_table = drv260x_of_match,
-		.pm	= &drv260x_pm_ops,
+		.pm	= pm_sleep_ptr(&drv260x_pm_ops),
 	},
 	.id_table = drv260x_id,
 };
-- 
2.39.0


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

* [PATCH 04/69] Input: drv2665 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (2 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 03/69] Input: drv260x " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 05/69] Input: drv2667 " Jonathan Cameron
                   ` (66 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/drv2665.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/drv2665.c b/drivers/input/misc/drv2665.c
index c2a2ff980c06..9145096f80ea 100644
--- a/drivers/input/misc/drv2665.c
+++ b/drivers/input/misc/drv2665.c
@@ -222,7 +222,7 @@ static int drv2665_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused drv2665_suspend(struct device *dev)
+static int drv2665_suspend(struct device *dev)
 {
 	struct drv2665_data *haptics = dev_get_drvdata(dev);
 	int ret = 0;
@@ -251,7 +251,7 @@ static int __maybe_unused drv2665_suspend(struct device *dev)
 	return ret;
 }
 
-static int __maybe_unused drv2665_resume(struct device *dev)
+static int drv2665_resume(struct device *dev)
 {
 	struct drv2665_data *haptics = dev_get_drvdata(dev);
 	int ret = 0;
@@ -280,7 +280,7 @@ static int __maybe_unused drv2665_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(drv2665_pm_ops, drv2665_suspend, drv2665_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(drv2665_pm_ops, drv2665_suspend, drv2665_resume);
 
 static const struct i2c_device_id drv2665_id[] = {
 	{ "drv2665", 0 },
@@ -301,7 +301,7 @@ static struct i2c_driver drv2665_driver = {
 	.driver		= {
 		.name	= "drv2665-haptics",
 		.of_match_table = of_match_ptr(drv2665_of_match),
-		.pm	= &drv2665_pm_ops,
+		.pm	= pm_sleep_ptr(&drv2665_pm_ops),
 	},
 	.id_table = drv2665_id,
 };
-- 
2.39.0


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

* [PATCH 05/69] Input: drv2667 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (3 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 04/69] Input: drv2665 " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 06/69] Input: e3x0-button " Jonathan Cameron
                   ` (65 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/drv2667.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
index da7ac63dce4c..88b4dbe3e5b5 100644
--- a/drivers/input/misc/drv2667.c
+++ b/drivers/input/misc/drv2667.c
@@ -399,7 +399,7 @@ static int drv2667_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused drv2667_suspend(struct device *dev)
+static int drv2667_suspend(struct device *dev)
 {
 	struct drv2667_data *haptics = dev_get_drvdata(dev);
 	int ret = 0;
@@ -428,7 +428,7 @@ static int __maybe_unused drv2667_suspend(struct device *dev)
 	return ret;
 }
 
-static int __maybe_unused drv2667_resume(struct device *dev)
+static int drv2667_resume(struct device *dev)
 {
 	struct drv2667_data *haptics = dev_get_drvdata(dev);
 	int ret = 0;
@@ -457,7 +457,7 @@ static int __maybe_unused drv2667_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(drv2667_pm_ops, drv2667_suspend, drv2667_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(drv2667_pm_ops, drv2667_suspend, drv2667_resume);
 
 static const struct i2c_device_id drv2667_id[] = {
 	{ "drv2667", 0 },
@@ -478,7 +478,7 @@ static struct i2c_driver drv2667_driver = {
 	.driver		= {
 		.name	= "drv2667-haptics",
 		.of_match_table = of_match_ptr(drv2667_of_match),
-		.pm	= &drv2667_pm_ops,
+		.pm	= pm_sleep_ptr(&drv2667_pm_ops),
 	},
 	.id_table = drv2667_id,
 };
-- 
2.39.0


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

* [PATCH 06/69] Input: e3x0-button - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (4 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 05/69] Input: drv2667 " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 07/69] Input: gpio-vibra " Jonathan Cameron
                   ` (64 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Moritz Fischer

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: Moritz Fischer <mdf@kernel.org>
---
 drivers/input/misc/e3x0-button.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/e3x0-button.c b/drivers/input/misc/e3x0-button.c
index e2fde6e1553f..5bd527117470 100644
--- a/drivers/input/misc/e3x0-button.c
+++ b/drivers/input/misc/e3x0-button.c
@@ -35,7 +35,7 @@ static irqreturn_t e3x0_button_press_handler(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int __maybe_unused e3x0_button_suspend(struct device *dev)
+static int e3x0_button_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 
@@ -45,7 +45,7 @@ static int __maybe_unused e3x0_button_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused e3x0_button_resume(struct device *dev)
+static int e3x0_button_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 
@@ -55,8 +55,8 @@ static int __maybe_unused e3x0_button_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(e3x0_button_pm_ops,
-			 e3x0_button_suspend, e3x0_button_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(e3x0_button_pm_ops,
+				e3x0_button_suspend, e3x0_button_resume);
 
 static int e3x0_button_probe(struct platform_device *pdev)
 {
@@ -122,7 +122,7 @@ static struct platform_driver e3x0_button_driver = {
 	.driver		= {
 		.name	= "e3x0-button",
 		.of_match_table = of_match_ptr(e3x0_button_match),
-		.pm	= &e3x0_button_pm_ops,
+		.pm	= pm_sleep_ptr(&e3x0_button_pm_ops),
 	},
 	.probe		= e3x0_button_probe,
 };
-- 
2.39.0


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

* [PATCH 07/69] Input: gpio-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (5 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 06/69] Input: e3x0-button " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 19:30   ` Luca Weiss
  2023-01-02 18:17 ` [PATCH 08/69] Input: iqs269a " Jonathan Cameron
                   ` (63 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Luca Weiss

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: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/input/misc/gpio-vibra.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/gpio-vibra.c b/drivers/input/misc/gpio-vibra.c
index f79f75595dd7..134a1309ba92 100644
--- a/drivers/input/misc/gpio-vibra.c
+++ b/drivers/input/misc/gpio-vibra.c
@@ -157,7 +157,7 @@ static int gpio_vibrator_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused gpio_vibrator_suspend(struct device *dev)
+static int gpio_vibrator_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct gpio_vibrator *vibrator = platform_get_drvdata(pdev);
@@ -169,7 +169,7 @@ static int __maybe_unused gpio_vibrator_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused gpio_vibrator_resume(struct device *dev)
+static int gpio_vibrator_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct gpio_vibrator *vibrator = platform_get_drvdata(pdev);
@@ -180,8 +180,8 @@ static int __maybe_unused gpio_vibrator_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(gpio_vibrator_pm_ops,
-			 gpio_vibrator_suspend, gpio_vibrator_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(gpio_vibrator_pm_ops,
+				gpio_vibrator_suspend, gpio_vibrator_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id gpio_vibra_dt_match_table[] = {
@@ -195,7 +195,7 @@ static struct platform_driver gpio_vibrator_driver = {
 	.probe	= gpio_vibrator_probe,
 	.driver	= {
 		.name	= "gpio-vibrator",
-		.pm	= &gpio_vibrator_pm_ops,
+		.pm	= pm_sleep_ptr(&gpio_vibrator_pm_ops),
 		.of_match_table = of_match_ptr(gpio_vibra_dt_match_table),
 	},
 };
-- 
2.39.0


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

* [PATCH 08/69] Input: iqs269a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (6 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 07/69] Input: gpio-vibra " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-03 18:14   ` Jeff LaBundy
  2023-01-02 18:17 ` [PATCH 09/69] Input: iqs626a " Jonathan Cameron
                   ` (62 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Jeff LaBundy

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: Jeff LaBundy <jeff@labundy.com>
---
 drivers/input/misc/iqs269a.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c
index a348247d3d38..8348d8c85e1d 100644
--- a/drivers/input/misc/iqs269a.c
+++ b/drivers/input/misc/iqs269a.c
@@ -1697,7 +1697,7 @@ static int iqs269_probe(struct i2c_client *client)
 	return error;
 }
 
-static int __maybe_unused iqs269_suspend(struct device *dev)
+static int iqs269_suspend(struct device *dev)
 {
 	struct iqs269_private *iqs269 = dev_get_drvdata(dev);
 	struct i2c_client *client = iqs269->client;
@@ -1756,7 +1756,7 @@ static int __maybe_unused iqs269_suspend(struct device *dev)
 	return error;
 }
 
-static int __maybe_unused iqs269_resume(struct device *dev)
+static int iqs269_resume(struct device *dev)
 {
 	struct iqs269_private *iqs269 = dev_get_drvdata(dev);
 	struct i2c_client *client = iqs269->client;
@@ -1803,7 +1803,7 @@ static int __maybe_unused iqs269_resume(struct device *dev)
 	return error;
 }
 
-static SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume);
 
 static const struct of_device_id iqs269_of_match[] = {
 	{ .compatible = "azoteq,iqs269a" },
@@ -1815,7 +1815,7 @@ static struct i2c_driver iqs269_i2c_driver = {
 	.driver = {
 		.name = "iqs269a",
 		.of_match_table = iqs269_of_match,
-		.pm = &iqs269_pm,
+		.pm = pm_sleep_ptr(&iqs269_pm),
 	},
 	.probe_new = iqs269_probe,
 };
-- 
2.39.0


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

* [PATCH 09/69] Input: iqs626a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (7 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 08/69] Input: iqs269a " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-03 18:14   ` Jeff LaBundy
  2023-01-02 18:17 ` [PATCH 10/69] Input: kxtj9 " Jonathan Cameron
                   ` (61 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/iqs626a.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/iqs626a.c b/drivers/input/misc/iqs626a.c
index 23b5dd9552dc..4727e6b95e41 100644
--- a/drivers/input/misc/iqs626a.c
+++ b/drivers/input/misc/iqs626a.c
@@ -1712,7 +1712,7 @@ static int iqs626_probe(struct i2c_client *client)
 	return error;
 }
 
-static int __maybe_unused iqs626_suspend(struct device *dev)
+static int iqs626_suspend(struct device *dev)
 {
 	struct iqs626_private *iqs626 = dev_get_drvdata(dev);
 	struct i2c_client *client = iqs626->client;
@@ -1771,7 +1771,7 @@ static int __maybe_unused iqs626_suspend(struct device *dev)
 	return error;
 }
 
-static int __maybe_unused iqs626_resume(struct device *dev)
+static int iqs626_resume(struct device *dev)
 {
 	struct iqs626_private *iqs626 = dev_get_drvdata(dev);
 	struct i2c_client *client = iqs626->client;
@@ -1818,7 +1818,7 @@ static int __maybe_unused iqs626_resume(struct device *dev)
 	return error;
 }
 
-static SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume);
 
 static const struct of_device_id iqs626_of_match[] = {
 	{ .compatible = "azoteq,iqs626a" },
@@ -1830,7 +1830,7 @@ static struct i2c_driver iqs626_i2c_driver = {
 	.driver = {
 		.name = "iqs626a",
 		.of_match_table = iqs626_of_match,
-		.pm = &iqs626_pm,
+		.pm = pm_sleep_ptr(&iqs626_pm),
 	},
 	.probe_new = iqs626_probe,
 };
-- 
2.39.0


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

* [PATCH 10/69] Input: kxtj9 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (8 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 09/69] Input: iqs626a " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 11/69] Input: max77693-haptic " Jonathan Cameron
                   ` (60 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/kxtj9.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index 7e73e6e0730f..4e806d56c55d 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -494,7 +494,7 @@ static int kxtj9_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused kxtj9_suspend(struct device *dev)
+static int kxtj9_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct kxtj9_data *tj9 = i2c_get_clientdata(client);
@@ -509,7 +509,7 @@ static int __maybe_unused kxtj9_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused kxtj9_resume(struct device *dev)
+static int kxtj9_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct kxtj9_data *tj9 = i2c_get_clientdata(client);
@@ -524,7 +524,7 @@ static int __maybe_unused kxtj9_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(kxtj9_pm_ops, kxtj9_suspend, kxtj9_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(kxtj9_pm_ops, kxtj9_suspend, kxtj9_resume);
 
 static const struct i2c_device_id kxtj9_id[] = {
 	{ NAME, 0 },
@@ -536,7 +536,7 @@ MODULE_DEVICE_TABLE(i2c, kxtj9_id);
 static struct i2c_driver kxtj9_driver = {
 	.driver = {
 		.name	= NAME,
-		.pm	= &kxtj9_pm_ops,
+		.pm	= pm_sleep_ptr(&kxtj9_pm_ops),
 	},
 	.probe_new	= kxtj9_probe,
 	.id_table	= kxtj9_id,
-- 
2.39.0


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

* [PATCH 11/69] Input: max77693-haptic - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (9 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 10/69] Input: kxtj9 " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-03  7:54   ` Krzysztof Kozlowski
  2023-01-02 18:17 ` [PATCH 12/69] Input: max8925_onkey " Jonathan Cameron
                   ` (59 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Krzysztof Kozlowski

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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/input/misc/max77693-haptic.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c
index 4369d3c04d38..80f4416ffe2f 100644
--- a/drivers/input/misc/max77693-haptic.c
+++ b/drivers/input/misc/max77693-haptic.c
@@ -375,7 +375,7 @@ static int max77693_haptic_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused max77693_haptic_suspend(struct device *dev)
+static int max77693_haptic_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct max77693_haptic *haptic = platform_get_drvdata(pdev);
@@ -388,7 +388,7 @@ static int __maybe_unused max77693_haptic_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused max77693_haptic_resume(struct device *dev)
+static int max77693_haptic_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct max77693_haptic *haptic = platform_get_drvdata(pdev);
@@ -401,8 +401,9 @@ static int __maybe_unused max77693_haptic_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops,
-			 max77693_haptic_suspend, max77693_haptic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops,
+				max77693_haptic_suspend,
+				max77693_haptic_resume);
 
 static const struct platform_device_id max77693_haptic_id[] = {
 	{ "max77693-haptic", TYPE_MAX77693 },
@@ -414,7 +415,7 @@ MODULE_DEVICE_TABLE(platform, max77693_haptic_id);
 static struct platform_driver max77693_haptic_driver = {
 	.driver		= {
 		.name	= "max77693-haptic",
-		.pm	= &max77693_haptic_pm_ops,
+		.pm	= pm_sleep_ptr(&max77693_haptic_pm_ops),
 	},
 	.probe		= max77693_haptic_probe,
 	.id_table	= max77693_haptic_id,
-- 
2.39.0


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

* [PATCH 12/69] Input: max8925_onkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (10 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 11/69] Input: max77693-haptic " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 13/69] Input: max8997_haptic " Jonathan Cameron
                   ` (58 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/max8925_onkey.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/max8925_onkey.c b/drivers/input/misc/max8925_onkey.c
index 4770cb55631a..62619e4fed20 100644
--- a/drivers/input/misc/max8925_onkey.c
+++ b/drivers/input/misc/max8925_onkey.c
@@ -129,7 +129,7 @@ static int max8925_onkey_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused max8925_onkey_suspend(struct device *dev)
+static int max8925_onkey_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct max8925_onkey_info *info = platform_get_drvdata(pdev);
@@ -143,7 +143,7 @@ static int __maybe_unused max8925_onkey_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused max8925_onkey_resume(struct device *dev)
+static int max8925_onkey_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct max8925_onkey_info *info = platform_get_drvdata(pdev);
@@ -157,12 +157,13 @@ static int __maybe_unused max8925_onkey_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops, max8925_onkey_suspend, max8925_onkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops,
+				max8925_onkey_suspend, max8925_onkey_resume);
 
 static struct platform_driver max8925_onkey_driver = {
 	.driver		= {
 		.name	= "max8925-onkey",
-		.pm	= &max8925_onkey_pm_ops,
+		.pm	= pm_sleep_ptr(&max8925_onkey_pm_ops),
 	},
 	.probe		= max8925_onkey_probe,
 };
-- 
2.39.0


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

* [PATCH 13/69] Input: max8997_haptic - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (11 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 12/69] Input: max8925_onkey " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 14/69] Input: palmas-pwrbutton " Jonathan Cameron
                   ` (57 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/max8997_haptic.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index 99cbc5ee89d1..c4dff476d479 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -366,7 +366,7 @@ static int max8997_haptic_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused max8997_haptic_suspend(struct device *dev)
+static int max8997_haptic_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct max8997_haptic *chip = platform_get_drvdata(pdev);
@@ -376,7 +376,8 @@ static int __maybe_unused max8997_haptic_suspend(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, max8997_haptic_suspend, NULL);
+static DEFINE_SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops,
+				max8997_haptic_suspend, NULL);
 
 static const struct platform_device_id max8997_haptic_id[] = {
 	{ "max8997-haptic", 0 },
@@ -387,7 +388,7 @@ MODULE_DEVICE_TABLE(platform, max8997_haptic_id);
 static struct platform_driver max8997_haptic_driver = {
 	.driver	= {
 		.name	= "max8997-haptic",
-		.pm	= &max8997_haptic_pm_ops,
+		.pm	= pm_sleep_ptr(&max8997_haptic_pm_ops),
 	},
 	.probe		= max8997_haptic_probe,
 	.remove		= max8997_haptic_remove,
-- 
2.39.0


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

* [PATCH 14/69] Input: palmas-pwrbutton - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (12 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 13/69] Input: max8997_haptic " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 15/69] Input: pcfg8574_keypad " Jonathan Cameron
                   ` (56 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Geert Uytterhoeven

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: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/input/misc/palmas-pwrbutton.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c
index 465e6693077a..7e361727b0d9 100644
--- a/drivers/input/misc/palmas-pwrbutton.c
+++ b/drivers/input/misc/palmas-pwrbutton.c
@@ -266,7 +266,7 @@ static int palmas_pwron_remove(struct platform_device *pdev)
  *
  * Return: 0
  */
-static int __maybe_unused palmas_pwron_suspend(struct device *dev)
+static int palmas_pwron_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct palmas_pwron *pwron = platform_get_drvdata(pdev);
@@ -287,7 +287,7 @@ static int __maybe_unused palmas_pwron_suspend(struct device *dev)
  *
  * Return: 0
  */
-static int __maybe_unused palmas_pwron_resume(struct device *dev)
+static int palmas_pwron_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct palmas_pwron *pwron = platform_get_drvdata(pdev);
@@ -298,8 +298,8 @@ static int __maybe_unused palmas_pwron_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(palmas_pwron_pm,
-			 palmas_pwron_suspend, palmas_pwron_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(palmas_pwron_pm,
+				palmas_pwron_suspend, palmas_pwron_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id of_palmas_pwr_match[] = {
@@ -316,7 +316,7 @@ static struct platform_driver palmas_pwron_driver = {
 	.driver	= {
 		.name	= "palmas_pwrbutton",
 		.of_match_table = of_match_ptr(of_palmas_pwr_match),
-		.pm	= &palmas_pwron_pm,
+		.pm	= pm_sleep_ptr(&palmas_pwron_pm),
 	},
 };
 module_platform_driver(palmas_pwron_driver);
-- 
2.39.0


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

* [PATCH 15/69] Input: pcfg8574_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (13 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 14/69] Input: palmas-pwrbutton " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 16/69] Input: pm8941-pwrkey " Jonathan Cameron
                   ` (55 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/pcf8574_keypad.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c
index fd1ff3f1cd92..6323c3d37ef7 100644
--- a/drivers/input/misc/pcf8574_keypad.c
+++ b/drivers/input/misc/pcf8574_keypad.c
@@ -167,7 +167,6 @@ static void pcf8574_kp_remove(struct i2c_client *client)
 	kfree(lp);
 }
 
-#ifdef CONFIG_PM
 static int pcf8574_kp_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -186,15 +185,8 @@ static int pcf8574_kp_suspend(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops pcf8574_kp_pm_ops = {
-	.suspend	= pcf8574_kp_suspend,
-	.resume		= pcf8574_kp_resume,
-};
-
-#else
-# define pcf8574_kp_resume  NULL
-# define pcf8574_kp_suspend NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(pcf8574_kp_pm_ops,
+				pcf8574_kp_suspend, pcf8574_kp_resume);
 
 static const struct i2c_device_id pcf8574_kp_id[] = {
 	{ DRV_NAME, 0 },
@@ -205,9 +197,7 @@ MODULE_DEVICE_TABLE(i2c, pcf8574_kp_id);
 static struct i2c_driver pcf8574_kp_driver = {
 	.driver = {
 		.name  = DRV_NAME,
-#ifdef CONFIG_PM
-		.pm = &pcf8574_kp_pm_ops,
-#endif
+		.pm = pm_sleep_ptr(&pcf8574_kp_pm_ops),
 	},
 	.probe_new = pcf8574_kp_probe,
 	.remove   = pcf8574_kp_remove,
-- 
2.39.0


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

* [PATCH 16/69] Input: pm8941-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (14 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 15/69] Input: pcfg8574_keypad " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-04  1:01   ` Stephen Boyd
  2023-01-02 18:17 ` [PATCH 17/69] Input: pm8xxx-vibrator " Jonathan Cameron
                   ` (54 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/pm8941-pwrkey.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c
index 549df01b6ee3..b6a27ebae977 100644
--- a/drivers/input/misc/pm8941-pwrkey.c
+++ b/drivers/input/misc/pm8941-pwrkey.c
@@ -217,7 +217,7 @@ static int pm8941_pwrkey_sw_debounce_init(struct pm8941_pwrkey *pwrkey)
 	return 0;
 }
 
-static int __maybe_unused pm8941_pwrkey_suspend(struct device *dev)
+static int pm8941_pwrkey_suspend(struct device *dev)
 {
 	struct pm8941_pwrkey *pwrkey = dev_get_drvdata(dev);
 
@@ -227,7 +227,7 @@ static int __maybe_unused pm8941_pwrkey_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused pm8941_pwrkey_resume(struct device *dev)
+static int pm8941_pwrkey_resume(struct device *dev)
 {
 	struct pm8941_pwrkey *pwrkey = dev_get_drvdata(dev);
 
@@ -237,8 +237,8 @@ static int __maybe_unused pm8941_pwrkey_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops,
-			 pm8941_pwrkey_suspend, pm8941_pwrkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops,
+				pm8941_pwrkey_suspend, pm8941_pwrkey_resume);
 
 static int pm8941_pwrkey_probe(struct platform_device *pdev)
 {
@@ -460,7 +460,7 @@ static struct platform_driver pm8941_pwrkey_driver = {
 	.remove = pm8941_pwrkey_remove,
 	.driver = {
 		.name = "pm8941-pwrkey",
-		.pm = &pm8941_pwr_key_pm_ops,
+		.pm = pm_sleep_ptr(&pm8941_pwr_key_pm_ops),
 		.of_match_table = of_match_ptr(pm8941_pwr_key_id_table),
 	},
 };
-- 
2.39.0


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

* [PATCH 17/69] Input: pm8xxx-vibrator - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (15 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 16/69] Input: pm8941-pwrkey " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 18/69] Input: pmic8xxx-pwrkey " Jonathan Cameron
                   ` (53 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Damien Riegel

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: Damien Riegel <damien.riegel@savoirfairelinux.com>
---
 drivers/input/misc/pm8xxx-vibrator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c
index 53ad25eaf1a2..04cb87efd799 100644
--- a/drivers/input/misc/pm8xxx-vibrator.c
+++ b/drivers/input/misc/pm8xxx-vibrator.c
@@ -226,7 +226,7 @@ static int pm8xxx_vib_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused pm8xxx_vib_suspend(struct device *dev)
+static int pm8xxx_vib_suspend(struct device *dev)
 {
 	struct pm8xxx_vib *vib = dev_get_drvdata(dev);
 
@@ -236,7 +236,7 @@ static int __maybe_unused pm8xxx_vib_suspend(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL);
 
 static const struct of_device_id pm8xxx_vib_id_table[] = {
 	{ .compatible = "qcom,pm8058-vib", .data = &pm8058_regs },
@@ -250,7 +250,7 @@ static struct platform_driver pm8xxx_vib_driver = {
 	.probe		= pm8xxx_vib_probe,
 	.driver		= {
 		.name	= "pm8xxx-vib",
-		.pm	= &pm8xxx_vib_pm_ops,
+		.pm	= pm_sleep_ptr(&pm8xxx_vib_pm_ops),
 		.of_match_table = pm8xxx_vib_id_table,
 	},
 };
-- 
2.39.0


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

* [PATCH 18/69] Input: pmic8xxx-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (16 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 17/69] Input: pm8xxx-vibrator " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-04  1:02   ` Stephen Boyd
  2023-01-02 18:17 ` [PATCH 19/69] Input: pwm-beeper " Jonathan Cameron
                   ` (52 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/pmic8xxx-pwrkey.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
index 0e818a3d28c5..89fb137e3715 100644
--- a/drivers/input/misc/pmic8xxx-pwrkey.c
+++ b/drivers/input/misc/pmic8xxx-pwrkey.c
@@ -100,7 +100,7 @@ static irqreturn_t pwrkey_release_irq(int irq, void *_pwr)
 	return IRQ_HANDLED;
 }
 
-static int __maybe_unused pmic8xxx_pwrkey_suspend(struct device *dev)
+static int pmic8xxx_pwrkey_suspend(struct device *dev)
 {
 	struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev);
 
@@ -110,7 +110,7 @@ static int __maybe_unused pmic8xxx_pwrkey_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused pmic8xxx_pwrkey_resume(struct device *dev)
+static int pmic8xxx_pwrkey_resume(struct device *dev)
 {
 	struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev);
 
@@ -120,7 +120,7 @@ static int __maybe_unused pmic8xxx_pwrkey_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops,
+static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops,
 		pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume);
 
 static void pmic8xxx_pwrkey_shutdown(struct platform_device *pdev)
@@ -442,7 +442,7 @@ static struct platform_driver pmic8xxx_pwrkey_driver = {
 	.shutdown	= pmic8xxx_pwrkey_shutdown,
 	.driver		= {
 		.name	= "pm8xxx-pwrkey",
-		.pm	= &pm8xxx_pwr_key_pm_ops,
+		.pm	= pm_sleep_ptr(&pm8xxx_pwr_key_pm_ops),
 		.of_match_table = pm8xxx_pwr_key_id_table,
 	},
 };
-- 
2.39.0


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

* [PATCH 19/69] Input: pwm-beeper - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (17 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 18/69] Input: pmic8xxx-pwrkey " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 20/69] Input: pwm-vibra " Jonathan Cameron
                   ` (51 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Lars-Peter Clausen

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: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/misc/pwm-beeper.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c
index d6b12477748a..3cf1812384e6 100644
--- a/drivers/input/misc/pwm-beeper.c
+++ b/drivers/input/misc/pwm-beeper.c
@@ -203,7 +203,7 @@ static int pwm_beeper_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused pwm_beeper_suspend(struct device *dev)
+static int pwm_beeper_suspend(struct device *dev)
 {
 	struct pwm_beeper *beeper = dev_get_drvdata(dev);
 
@@ -221,7 +221,7 @@ static int __maybe_unused pwm_beeper_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused pwm_beeper_resume(struct device *dev)
+static int pwm_beeper_resume(struct device *dev)
 {
 	struct pwm_beeper *beeper = dev_get_drvdata(dev);
 
@@ -235,8 +235,8 @@ static int __maybe_unused pwm_beeper_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops,
-			 pwm_beeper_suspend, pwm_beeper_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops,
+				pwm_beeper_suspend, pwm_beeper_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id pwm_beeper_match[] = {
@@ -250,7 +250,7 @@ static struct platform_driver pwm_beeper_driver = {
 	.probe	= pwm_beeper_probe,
 	.driver = {
 		.name	= "pwm-beeper",
-		.pm	= &pwm_beeper_pm_ops,
+		.pm	= pm_sleep_ptr(&pwm_beeper_pm_ops),
 		.of_match_table = of_match_ptr(pwm_beeper_match),
 	},
 };
-- 
2.39.0


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

* [PATCH 20/69] Input: pwm-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (18 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 19/69] Input: pwm-beeper " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 21/69] Input: regulator-haptic " Jonathan Cameron
                   ` (50 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/pwm-vibra.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
index 81e777a04b88..d0e58a7cdfa3 100644
--- a/drivers/input/misc/pwm-vibra.c
+++ b/drivers/input/misc/pwm-vibra.c
@@ -222,7 +222,7 @@ static int pwm_vibrator_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused pwm_vibrator_suspend(struct device *dev)
+static int pwm_vibrator_suspend(struct device *dev)
 {
 	struct pwm_vibrator *vibrator = dev_get_drvdata(dev);
 
@@ -233,7 +233,7 @@ static int __maybe_unused pwm_vibrator_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused pwm_vibrator_resume(struct device *dev)
+static int pwm_vibrator_resume(struct device *dev)
 {
 	struct pwm_vibrator *vibrator = dev_get_drvdata(dev);
 
@@ -243,8 +243,8 @@ static int __maybe_unused pwm_vibrator_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(pwm_vibrator_pm_ops,
-			 pwm_vibrator_suspend, pwm_vibrator_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pwm_vibrator_pm_ops,
+				pwm_vibrator_suspend, pwm_vibrator_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id pwm_vibra_dt_match_table[] = {
@@ -258,7 +258,7 @@ static struct platform_driver pwm_vibrator_driver = {
 	.probe	= pwm_vibrator_probe,
 	.driver	= {
 		.name	= "pwm-vibrator",
-		.pm	= &pwm_vibrator_pm_ops,
+		.pm	= pm_sleep_ptr(&pwm_vibrator_pm_ops),
 		.of_match_table = of_match_ptr(pwm_vibra_dt_match_table),
 	},
 };
-- 
2.39.0


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

* [PATCH 21/69] Input: regulator-haptic - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (19 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 20/69] Input: pwm-vibra " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 22/69] Input: rotary-encoder " Jonathan Cameron
                   ` (49 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/regulator-haptic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c
index a661e77545c5..02f73b7c0462 100644
--- a/drivers/input/misc/regulator-haptic.c
+++ b/drivers/input/misc/regulator-haptic.c
@@ -201,7 +201,7 @@ static int regulator_haptic_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused regulator_haptic_suspend(struct device *dev)
+static int regulator_haptic_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct regulator_haptic *haptic = platform_get_drvdata(pdev);
@@ -220,7 +220,7 @@ static int __maybe_unused regulator_haptic_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused regulator_haptic_resume(struct device *dev)
+static int regulator_haptic_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct regulator_haptic *haptic = platform_get_drvdata(pdev);
@@ -239,7 +239,7 @@ static int __maybe_unused regulator_haptic_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(regulator_haptic_pm_ops,
+static DEFINE_SIMPLE_DEV_PM_OPS(regulator_haptic_pm_ops,
 		regulator_haptic_suspend, regulator_haptic_resume);
 
 static const struct of_device_id regulator_haptic_dt_match[] = {
@@ -253,7 +253,7 @@ static struct platform_driver regulator_haptic_driver = {
 	.driver		= {
 		.name		= "regulator-haptic",
 		.of_match_table = regulator_haptic_dt_match,
-		.pm		= &regulator_haptic_pm_ops,
+		.pm		= pm_sleep_ptr(&regulator_haptic_pm_ops),
 	},
 };
 module_platform_driver(regulator_haptic_driver);
-- 
2.39.0


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

* [PATCH 22/69] Input: rotary-encoder - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (20 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 21/69] Input: regulator-haptic " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 23/69] Input: stpmic1_onekey " Jonathan Cameron
                   ` (48 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 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/misc/rotary_encoder.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 6d613f2a017c..22ec62083065 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -317,7 +317,7 @@ static int rotary_encoder_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused rotary_encoder_suspend(struct device *dev)
+static int rotary_encoder_suspend(struct device *dev)
 {
 	struct rotary_encoder *encoder = dev_get_drvdata(dev);
 	unsigned int i;
@@ -330,7 +330,7 @@ static int __maybe_unused rotary_encoder_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused rotary_encoder_resume(struct device *dev)
+static int rotary_encoder_resume(struct device *dev)
 {
 	struct rotary_encoder *encoder = dev_get_drvdata(dev);
 	unsigned int i;
@@ -343,8 +343,8 @@ static int __maybe_unused rotary_encoder_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(rotary_encoder_pm_ops,
-			 rotary_encoder_suspend, rotary_encoder_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rotary_encoder_pm_ops,
+				rotary_encoder_suspend, rotary_encoder_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id rotary_encoder_of_match[] = {
@@ -358,7 +358,7 @@ static struct platform_driver rotary_encoder_driver = {
 	.probe		= rotary_encoder_probe,
 	.driver		= {
 		.name	= DRV_NAME,
-		.pm	= &rotary_encoder_pm_ops,
+		.pm	= pm_sleep_ptr(&rotary_encoder_pm_ops),
 		.of_match_table = of_match_ptr(rotary_encoder_of_match),
 	}
 };
-- 
2.39.0


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

* [PATCH 23/69] Input: stpmic1_onekey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (21 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 22/69] Input: rotary-encoder " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 24/69] Input: twl4030-vibra " Jonathan Cameron
                   ` (47 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Pascal Paillet

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: Pascal Paillet <p.paillet@st.com>
---
 drivers/input/misc/stpmic1_onkey.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/input/misc/stpmic1_onkey.c b/drivers/input/misc/stpmic1_onkey.c
index d8dc2f2f8000..d5ebca7b90a5 100644
--- a/drivers/input/misc/stpmic1_onkey.c
+++ b/drivers/input/misc/stpmic1_onkey.c
@@ -142,7 +142,7 @@ static int stpmic1_onkey_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused stpmic1_onkey_suspend(struct device *dev)
+static int stpmic1_onkey_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
@@ -154,7 +154,7 @@ static int __maybe_unused stpmic1_onkey_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused stpmic1_onkey_resume(struct device *dev)
+static int stpmic1_onkey_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
@@ -166,9 +166,9 @@ static int __maybe_unused stpmic1_onkey_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(stpmic1_onkey_pm,
-			 stpmic1_onkey_suspend,
-			 stpmic1_onkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stpmic1_onkey_pm,
+				stpmic1_onkey_suspend,
+				stpmic1_onkey_resume);
 
 static const struct of_device_id of_stpmic1_onkey_match[] = {
 	{ .compatible = "st,stpmic1-onkey" },
@@ -182,7 +182,7 @@ static struct platform_driver stpmic1_onkey_driver = {
 	.driver	= {
 		.name	= "stpmic1_onkey",
 		.of_match_table = of_match_ptr(of_stpmic1_onkey_match),
-		.pm	= &stpmic1_onkey_pm,
+		.pm	= pm_sleep_ptr(&stpmic1_onkey_pm),
 	},
 };
 module_platform_driver(stpmic1_onkey_driver);
-- 
2.39.0


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

* [PATCH 24/69] Input: twl4030-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (22 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 23/69] Input: stpmic1_onekey " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 25/69] Input: twl6030-vibra " Jonathan Cameron
                   ` (46 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Tony Lindgren

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: Tony Lindgren <tony@atomide.com>
---
 drivers/input/misc/twl4030-vibra.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index 5619996da86f..101548b35ee3 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -143,7 +143,7 @@ static void twl4030_vibra_close(struct input_dev *input)
 }
 
 /*** Module ***/
-static int __maybe_unused twl4030_vibra_suspend(struct device *dev)
+static int twl4030_vibra_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct vibra_info *info = platform_get_drvdata(pdev);
@@ -154,14 +154,14 @@ static int __maybe_unused twl4030_vibra_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused twl4030_vibra_resume(struct device *dev)
+static int twl4030_vibra_resume(struct device *dev)
 {
 	vibra_disable_leds();
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
-			 twl4030_vibra_suspend, twl4030_vibra_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
+				twl4030_vibra_suspend, twl4030_vibra_resume);
 
 static bool twl4030_vibra_check_coexist(struct device_node *parent)
 {
@@ -234,7 +234,7 @@ static struct platform_driver twl4030_vibra_driver = {
 	.probe		= twl4030_vibra_probe,
 	.driver		= {
 		.name	= "twl4030-vibra",
-		.pm	= &twl4030_vibra_pm_ops,
+		.pm	= pm_sleep_ptr(&twl4030_vibra_pm_ops),
 	},
 };
 module_platform_driver(twl4030_vibra_driver);
-- 
2.39.0


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

* [PATCH 25/69] Input: twl6030-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (23 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 24/69] Input: twl4030-vibra " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-02 18:17 ` [PATCH 26/69] Input: elan_i2c_core " Jonathan Cameron
                   ` (45 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Tony Lindgren

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: Tony Lindgren <tony@atomide.com>
---
 drivers/input/misc/twl6040-vibra.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
index bf6644927630..78f0b63e5c20 100644
--- a/drivers/input/misc/twl6040-vibra.c
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -210,7 +210,7 @@ static void twl6040_vibra_close(struct input_dev *input)
 		twl6040_vibra_disable(info);
 }
 
-static int __maybe_unused twl6040_vibra_suspend(struct device *dev)
+static int twl6040_vibra_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct vibra_info *info = platform_get_drvdata(pdev);
@@ -223,7 +223,8 @@ static int __maybe_unused twl6040_vibra_suspend(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);
+static DEFINE_SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops,
+				twl6040_vibra_suspend, NULL);
 
 static int twl6040_vibra_probe(struct platform_device *pdev)
 {
@@ -354,7 +355,7 @@ static struct platform_driver twl6040_vibra_driver = {
 	.probe		= twl6040_vibra_probe,
 	.driver		= {
 		.name	= "twl6040-vibra",
-		.pm	= &twl6040_vibra_pm_ops,
+		.pm	= pm_sleep_ptr(&twl6040_vibra_pm_ops),
 	},
 };
 module_platform_driver(twl6040_vibra_driver);
-- 
2.39.0


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

* [PATCH 26/69] Input: elan_i2c_core - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (24 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 25/69] Input: twl6030-vibra " Jonathan Cameron
@ 2023-01-02 18:17 ` Jonathan Cameron
  2023-01-09  8:44   ` Hans de Goede
  2023-01-02 18:18 ` [PATCH 27/69] Input: navpoint " Jonathan Cameron
                   ` (44 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:17 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Raul E Rangel, Hans de Goede

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: Raul E Rangel <rrangel@chromium.org>
Cc: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/mouse/elan_i2c_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 76729ada1582..5f0d75a45c80 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -1328,7 +1328,7 @@ static int elan_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused elan_suspend(struct device *dev)
+static int elan_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct elan_tp_data *data = i2c_get_clientdata(client);
@@ -1365,7 +1365,7 @@ static int __maybe_unused elan_suspend(struct device *dev)
 	return ret;
 }
 
-static int __maybe_unused elan_resume(struct device *dev)
+static int elan_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct elan_tp_data *data = i2c_get_clientdata(client);
@@ -1394,7 +1394,7 @@ static int __maybe_unused elan_resume(struct device *dev)
 	return error;
 }
 
-static SIMPLE_DEV_PM_OPS(elan_pm_ops, elan_suspend, elan_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(elan_pm_ops, elan_suspend, elan_resume);
 
 static const struct i2c_device_id elan_id[] = {
 	{ DRIVER_NAME, 0 },
@@ -1418,7 +1418,7 @@ MODULE_DEVICE_TABLE(of, elan_of_match);
 static struct i2c_driver elan_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
-		.pm	= &elan_pm_ops,
+		.pm	= pm_sleep_ptr(&elan_pm_ops),
 		.acpi_match_table = ACPI_PTR(elan_acpi_id),
 		.of_match_table = of_match_ptr(elan_of_match),
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-- 
2.39.0


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

* [PATCH 27/69] Input: navpoint - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (25 preceding siblings ...)
  2023-01-02 18:17 ` [PATCH 26/69] Input: elan_i2c_core " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 28/69] Input: synaptics_i2c " Jonathan Cameron
                   ` (43 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/mouse/navpoint.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c
index 4d67575bb276..2b7b86eef280 100644
--- a/drivers/input/mouse/navpoint.c
+++ b/drivers/input/mouse/navpoint.c
@@ -315,7 +315,7 @@ static int navpoint_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused navpoint_suspend(struct device *dev)
+static int navpoint_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct navpoint *navpoint = platform_get_drvdata(pdev);
@@ -329,7 +329,7 @@ static int __maybe_unused navpoint_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused navpoint_resume(struct device *dev)
+static int navpoint_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct navpoint *navpoint = platform_get_drvdata(pdev);
@@ -343,14 +343,15 @@ static int __maybe_unused navpoint_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(navpoint_pm_ops, navpoint_suspend, navpoint_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(navpoint_pm_ops,
+				navpoint_suspend, navpoint_resume);
 
 static struct platform_driver navpoint_driver = {
 	.probe		= navpoint_probe,
 	.remove		= navpoint_remove,
 	.driver = {
 		.name	= "navpoint",
-		.pm	= &navpoint_pm_ops,
+		.pm	= pm_sleep_ptr(&navpoint_pm_ops),
 	},
 };
 
-- 
2.39.0


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

* [PATCH 28/69] Input: synaptics_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (26 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 27/69] Input: navpoint " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 29/69] Input: ambakmi " Jonathan Cameron
                   ` (42 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/mouse/synaptics_i2c.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index 6487c8c60d5e..068692a8aba5 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -597,7 +597,7 @@ static void synaptics_i2c_remove(struct i2c_client *client)
 	kfree(touch);
 }
 
-static int __maybe_unused synaptics_i2c_suspend(struct device *dev)
+static int synaptics_i2c_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct synaptics_i2c *touch = i2c_get_clientdata(client);
@@ -610,7 +610,7 @@ static int __maybe_unused synaptics_i2c_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused synaptics_i2c_resume(struct device *dev)
+static int synaptics_i2c_resume(struct device *dev)
 {
 	int ret;
 	struct i2c_client *client = to_i2c_client(dev);
@@ -626,8 +626,8 @@ static int __maybe_unused synaptics_i2c_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
-			 synaptics_i2c_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
+				synaptics_i2c_resume);
 
 static const struct i2c_device_id synaptics_i2c_id_table[] = {
 	{ "synaptics_i2c", 0 },
@@ -647,7 +647,7 @@ static struct i2c_driver synaptics_i2c_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
 		.of_match_table = of_match_ptr(synaptics_i2c_of_match),
-		.pm	= &synaptics_i2c_pm,
+		.pm	= pm_sleep_ptr(&synaptics_i2c_pm),
 	},
 
 	.probe_new	= synaptics_i2c_probe,
-- 
2.39.0


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

* [PATCH 29/69] Input: ambakmi - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (27 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 28/69] Input: synaptics_i2c " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 30/69] Input: ad7877 " Jonathan Cameron
                   ` (41 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/serio/ambakmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index c391700fc4ae..8fbfa448be4a 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -170,7 +170,7 @@ static void amba_kmi_remove(struct amba_device *dev)
 	amba_release_regions(dev);
 }
 
-static int __maybe_unused amba_kmi_resume(struct device *dev)
+static int amba_kmi_resume(struct device *dev)
 {
 	struct amba_kmi_port *kmi = dev_get_drvdata(dev);
 
@@ -180,7 +180,7 @@ static int __maybe_unused amba_kmi_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume);
 
 static const struct amba_id amba_kmi_idtable[] = {
 	{
@@ -196,7 +196,7 @@ static struct amba_driver ambakmi_driver = {
 	.drv		= {
 		.name	= "kmi-pl050",
 		.owner	= THIS_MODULE,
-		.pm	= &amba_kmi_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&amba_kmi_dev_pm_ops),
 	},
 	.id_table	= amba_kmi_idtable,
 	.probe		= amba_kmi_probe,
-- 
2.39.0


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

* [PATCH 30/69] Input: ad7877 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (28 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 29/69] Input: ambakmi " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-09 10:18   ` Hennerich, Michael
  2023-01-02 18:18 ` [PATCH 31/69] Input: ads7846 " Jonathan Cameron
                   ` (40 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/ad7877.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index 08f5372f0bfd..edb36d663f22 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -788,7 +788,7 @@ static int ad7877_probe(struct spi_device *spi)
 	return 0;
 }
 
-static int __maybe_unused ad7877_suspend(struct device *dev)
+static int ad7877_suspend(struct device *dev)
 {
 	struct ad7877 *ts = dev_get_drvdata(dev);
 
@@ -797,7 +797,7 @@ static int __maybe_unused ad7877_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ad7877_resume(struct device *dev)
+static int ad7877_resume(struct device *dev)
 {
 	struct ad7877 *ts = dev_get_drvdata(dev);
 
@@ -806,12 +806,12 @@ static int __maybe_unused ad7877_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
 
 static struct spi_driver ad7877_driver = {
 	.driver = {
 		.name	= "ad7877",
-		.pm	= &ad7877_pm,
+		.pm	= pm_sleep_ptr(&ad7877_pm),
 	},
 	.probe		= ad7877_probe,
 };
-- 
2.39.0


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

* [PATCH 31/69] Input: ads7846 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (29 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 30/69] Input: ad7877 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 32/69] Input: ar1021 " Jonathan Cameron
                   ` (39 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/ads7846.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index bed68a68f330..4c3dd01902d0 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -944,7 +944,7 @@ static irqreturn_t ads7846_irq(int irq, void *handle)
 	return IRQ_HANDLED;
 }
 
-static int __maybe_unused ads7846_suspend(struct device *dev)
+static int ads7846_suspend(struct device *dev)
 {
 	struct ads7846 *ts = dev_get_drvdata(dev);
 
@@ -966,7 +966,7 @@ static int __maybe_unused ads7846_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ads7846_resume(struct device *dev)
+static int ads7846_resume(struct device *dev)
 {
 	struct ads7846 *ts = dev_get_drvdata(dev);
 
@@ -988,7 +988,7 @@ static int __maybe_unused ads7846_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);
 
 static int ads7846_setup_pendown(struct spi_device *spi,
 				 struct ads7846 *ts,
@@ -1421,7 +1421,7 @@ static void ads7846_remove(struct spi_device *spi)
 static struct spi_driver ads7846_driver = {
 	.driver = {
 		.name	= "ads7846",
-		.pm	= &ads7846_pm,
+		.pm	= pm_sleep_ptr(&ads7846_pm),
 		.of_match_table = of_match_ptr(ads7846_dt_ids),
 	},
 	.probe		= ads7846_probe,
-- 
2.39.0


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

* [PATCH 32/69] Input: ar1021 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (30 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 31/69] Input: ads7846 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 33/69] Input: atmel_mxt_ts " Jonathan Cameron
                   ` (38 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/ar1021_i2c.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c
index 25bcc677e98b..3a5b65cae360 100644
--- a/drivers/input/touchscreen/ar1021_i2c.c
+++ b/drivers/input/touchscreen/ar1021_i2c.c
@@ -142,7 +142,7 @@ static int ar1021_i2c_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused ar1021_i2c_suspend(struct device *dev)
+static int ar1021_i2c_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -151,7 +151,7 @@ static int __maybe_unused ar1021_i2c_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ar1021_i2c_resume(struct device *dev)
+static int ar1021_i2c_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -160,7 +160,8 @@ static int __maybe_unused ar1021_i2c_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, ar1021_i2c_suspend, ar1021_i2c_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ar1021_i2c_pm,
+				ar1021_i2c_suspend, ar1021_i2c_resume);
 
 static const struct i2c_device_id ar1021_i2c_id[] = {
 	{ "ar1021", 0 },
@@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE(of, ar1021_i2c_of_match);
 static struct i2c_driver ar1021_i2c_driver = {
 	.driver	= {
 		.name	= "ar1021_i2c",
-		.pm	= &ar1021_i2c_pm,
+		.pm	= pm_sleep_ptr(&ar1021_i2c_pm),
 		.of_match_table = ar1021_i2c_of_match,
 	},
 
-- 
2.39.0


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

* [PATCH 33/69] Input: atmel_mxt_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (31 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 32/69] Input: ar1021 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-03  8:45   ` Claudiu.Beznea
  2023-01-02 18:18 ` [PATCH 34/69] Input: auo-pixcir-ts " Jonathan Cameron
                   ` (37 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea

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: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/input/touchscreen/atmel_mxt_ts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 39ef2664b852..996bf434e1cb 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3296,7 +3296,7 @@ static void mxt_remove(struct i2c_client *client)
 			       data->regulators);
 }
 
-static int __maybe_unused mxt_suspend(struct device *dev)
+static int mxt_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mxt_data *data = i2c_get_clientdata(client);
@@ -3317,7 +3317,7 @@ static int __maybe_unused mxt_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mxt_resume(struct device *dev)
+static int mxt_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mxt_data *data = i2c_get_clientdata(client);
@@ -3338,7 +3338,7 @@ static int __maybe_unused mxt_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
 
 static const struct of_device_id mxt_of_match[] = {
 	{ .compatible = "atmel,maxtouch", },
@@ -3375,7 +3375,7 @@ static struct i2c_driver mxt_driver = {
 		.name	= "atmel_mxt_ts",
 		.of_match_table = mxt_of_match,
 		.acpi_match_table = ACPI_PTR(mxt_acpi_id),
-		.pm	= &mxt_pm_ops,
+		.pm	= pm_sleep_ptr(&mxt_pm_ops),
 	},
 	.probe_new	= mxt_probe,
 	.remove		= mxt_remove,
-- 
2.39.0


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

* [PATCH 34/69] Input: auo-pixcir-ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (32 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 33/69] Input: atmel_mxt_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-04 10:33   ` Heiko Stübner
  2023-01-02 18:18 ` [PATCH 35/69] Input: bu21013_ts " Jonathan Cameron
                   ` (36 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Heiko Stuebner

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: Heiko Stuebner <heiko@sntech.de>
---
 drivers/input/touchscreen/auo-pixcir-ts.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index a4a1d58aeeac..5359efc80b2b 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -410,7 +410,7 @@ static void auo_pixcir_input_close(struct input_dev *dev)
 	auo_pixcir_stop(ts);
 }
 
-static int __maybe_unused auo_pixcir_suspend(struct device *dev)
+static int auo_pixcir_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
@@ -442,7 +442,7 @@ static int __maybe_unused auo_pixcir_suspend(struct device *dev)
 	return ret;
 }
 
-static int __maybe_unused auo_pixcir_resume(struct device *dev)
+static int auo_pixcir_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
@@ -472,8 +472,8 @@ static int __maybe_unused auo_pixcir_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops,
-			 auo_pixcir_suspend, auo_pixcir_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops,
+				auo_pixcir_suspend, auo_pixcir_resume);
 
 static void auo_pixcir_reset(void *data)
 {
@@ -633,7 +633,7 @@ MODULE_DEVICE_TABLE(of, auo_pixcir_ts_dt_idtable);
 static struct i2c_driver auo_pixcir_driver = {
 	.driver = {
 		.name	= "auo_pixcir_ts",
-		.pm	= &auo_pixcir_pm_ops,
+		.pm	= pm_sleep_ptr(&auo_pixcir_pm_ops),
 		.of_match_table	= of_match_ptr(auo_pixcir_ts_dt_idtable),
 	},
 	.probe_new	= auo_pixcir_probe,
-- 
2.39.0


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

* [PATCH 35/69] Input: bu21013_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (33 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 34/69] Input: auo-pixcir-ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 36/69] Input: bu21029 " Jonathan Cameron
                   ` (35 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/bu21013_ts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c
index 5a4dbd39a372..c994ab6f4e58 100644
--- a/drivers/input/touchscreen/bu21013_ts.c
+++ b/drivers/input/touchscreen/bu21013_ts.c
@@ -560,7 +560,7 @@ static void bu21013_remove(struct i2c_client *client)
 	/* The resources will be freed by devm */
 }
 
-static int __maybe_unused bu21013_suspend(struct device *dev)
+static int bu21013_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct bu21013_ts *ts = i2c_get_clientdata(client);
@@ -575,7 +575,7 @@ static int __maybe_unused bu21013_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused bu21013_resume(struct device *dev)
+static int bu21013_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct bu21013_ts *ts = i2c_get_clientdata(client);
@@ -604,7 +604,7 @@ static int __maybe_unused bu21013_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume);
 
 static const struct i2c_device_id bu21013_id[] = {
 	{ DRIVER_TP, 0 },
@@ -615,7 +615,7 @@ MODULE_DEVICE_TABLE(i2c, bu21013_id);
 static struct i2c_driver bu21013_driver = {
 	.driver	= {
 		.name	=	DRIVER_TP,
-		.pm	=	&bu21013_dev_pm_ops,
+		.pm	=	pm_sleep_ptr(&bu21013_dev_pm_ops),
 	},
 	.probe_new	=	bu21013_probe,
 	.remove		=	bu21013_remove,
-- 
2.39.0


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

* [PATCH 36/69] Input: bu21029 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (34 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 35/69] Input: bu21013_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 37/69] Input: chipone_in8318 " Jonathan Cameron
                   ` (34 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Zhu Yi, Mark Jonas

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: Zhu Yi <yi.zhu5@cn.bosch.com>
Cc: Mark Jonas <mark.jonas@de.bosch.com>
---
 drivers/input/touchscreen/bu21029_ts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/bu21029_ts.c b/drivers/input/touchscreen/bu21029_ts.c
index 215f4dc5105d..8f1442894ff9 100644
--- a/drivers/input/touchscreen/bu21029_ts.c
+++ b/drivers/input/touchscreen/bu21029_ts.c
@@ -422,7 +422,7 @@ static int bu21029_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused bu21029_suspend(struct device *dev)
+static int bu21029_suspend(struct device *dev)
 {
 	struct i2c_client *i2c = to_i2c_client(dev);
 	struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
@@ -437,7 +437,7 @@ static int __maybe_unused bu21029_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused bu21029_resume(struct device *dev)
+static int bu21029_resume(struct device *dev)
 {
 	struct i2c_client *i2c = to_i2c_client(dev);
 	struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
@@ -451,7 +451,7 @@ static int __maybe_unused bu21029_resume(struct device *dev)
 
 	return 0;
 }
-static SIMPLE_DEV_PM_OPS(bu21029_pm_ops, bu21029_suspend, bu21029_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(bu21029_pm_ops, bu21029_suspend, bu21029_resume);
 
 static const struct i2c_device_id bu21029_ids[] = {
 	{ DRIVER_NAME, 0 },
@@ -471,7 +471,7 @@ static struct i2c_driver bu21029_driver = {
 	.driver	= {
 		.name		= DRIVER_NAME,
 		.of_match_table	= of_match_ptr(bu21029_of_ids),
-		.pm		= &bu21029_pm_ops,
+		.pm		= pm_sleep_ptr(&bu21029_pm_ops),
 	},
 	.id_table	= bu21029_ids,
 	.probe_new	= bu21029_probe,
-- 
2.39.0


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

* [PATCH 37/69] Input: chipone_in8318 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (35 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 36/69] Input: bu21029 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-09  8:44   ` Hans de Goede
  2023-01-02 18:18 ` [PATCH 38/69] Input: chipone_icn8505 " Jonathan Cameron
                   ` (33 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Hans de Goede

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: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/touchscreen/chipone_icn8318.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c
index f6769e4bd4f2..32b714a6ed2d 100644
--- a/drivers/input/touchscreen/chipone_icn8318.c
+++ b/drivers/input/touchscreen/chipone_icn8318.c
@@ -148,7 +148,6 @@ static void icn8318_stop(struct input_dev *dev)
 	gpiod_set_value_cansleep(data->wake_gpio, 0);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int icn8318_suspend(struct device *dev)
 {
 	struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev));
@@ -172,9 +171,8 @@ static int icn8318_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume);
 
 static int icn8318_probe(struct i2c_client *client)
 {
@@ -263,7 +261,7 @@ MODULE_DEVICE_TABLE(i2c, icn8318_i2c_id);
 static struct i2c_driver icn8318_driver = {
 	.driver = {
 		.name	= "chipone_icn8318",
-		.pm	= &icn8318_pm_ops,
+		.pm	= pm_sleep_ptr(&icn8318_pm_ops),
 		.of_match_table = icn8318_of_match,
 	},
 	.probe_new = icn8318_probe,
-- 
2.39.0


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

* [PATCH 38/69] Input: chipone_icn8505 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (36 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 37/69] Input: chipone_in8318 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-09  8:44   ` Hans de Goede
  2023-01-02 18:18 ` [PATCH 39/69] Input: cy8ctma140 " Jonathan Cameron
                   ` (32 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Hans de Goede

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: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/touchscreen/chipone_icn8505.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/chipone_icn8505.c b/drivers/input/touchscreen/chipone_icn8505.c
index c421f4be2700..246bee0bee53 100644
--- a/drivers/input/touchscreen/chipone_icn8505.c
+++ b/drivers/input/touchscreen/chipone_icn8505.c
@@ -460,7 +460,7 @@ static int icn8505_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused icn8505_suspend(struct device *dev)
+static int icn8505_suspend(struct device *dev)
 {
 	struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev));
 
@@ -471,7 +471,7 @@ static int __maybe_unused icn8505_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused icn8505_resume(struct device *dev)
+static int icn8505_resume(struct device *dev)
 {
 	struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev));
 	int error;
@@ -484,7 +484,7 @@ static int __maybe_unused icn8505_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume);
 
 static const struct acpi_device_id icn8505_acpi_match[] = {
 	{ "CHPN0001" },
@@ -495,7 +495,7 @@ MODULE_DEVICE_TABLE(acpi, icn8505_acpi_match);
 static struct i2c_driver icn8505_driver = {
 	.driver = {
 		.name	= "chipone_icn8505",
-		.pm	= &icn8505_pm_ops,
+		.pm	= pm_sleep_ptr(&icn8505_pm_ops),
 		.acpi_match_table = icn8505_acpi_match,
 	},
 	.probe_new = icn8505_probe,
-- 
2.39.0


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

* [PATCH 39/69] Input: cy8ctma140 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (37 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 38/69] Input: chipone_icn8505 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 40/69] Input: cy8ctmg110_ts " Jonathan Cameron
                   ` (31 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/cy8ctma140.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/cy8ctma140.c b/drivers/input/touchscreen/cy8ctma140.c
index 3a91d948b7f6..cd86477d971a 100644
--- a/drivers/input/touchscreen/cy8ctma140.c
+++ b/drivers/input/touchscreen/cy8ctma140.c
@@ -296,7 +296,7 @@ static int cy8ctma140_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused cy8ctma140_suspend(struct device *dev)
+static int cy8ctma140_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cy8ctma140 *ts = i2c_get_clientdata(client);
@@ -307,7 +307,7 @@ static int __maybe_unused cy8ctma140_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused cy8ctma140_resume(struct device *dev)
+static int cy8ctma140_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cy8ctma140 *ts = i2c_get_clientdata(client);
@@ -322,7 +322,8 @@ static int __maybe_unused cy8ctma140_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(cy8ctma140_pm, cy8ctma140_suspend, cy8ctma140_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cy8ctma140_pm,
+				cy8ctma140_suspend, cy8ctma140_resume);
 
 static const struct i2c_device_id cy8ctma140_idtable[] = {
 	{ CY8CTMA140_NAME, 0 },
@@ -339,7 +340,7 @@ MODULE_DEVICE_TABLE(of, cy8ctma140_of_match);
 static struct i2c_driver cy8ctma140_driver = {
 	.driver		= {
 		.name	= CY8CTMA140_NAME,
-		.pm	= &cy8ctma140_pm,
+		.pm	= pm_sleep_ptr(&cy8ctma140_pm),
 		.of_match_table = cy8ctma140_of_match,
 	},
 	.id_table	= cy8ctma140_idtable,
-- 
2.39.0


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

* [PATCH 40/69] Input: cy8ctmg110_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (38 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 39/69] Input: cy8ctma140 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 41/69] Input: edt-ft5x06 " Jonathan Cameron
                   ` (30 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/cy8ctmg110_ts.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c
index 7c2b7309dbaf..dcf50fbf6dc7 100644
--- a/drivers/input/touchscreen/cy8ctmg110_ts.c
+++ b/drivers/input/touchscreen/cy8ctmg110_ts.c
@@ -237,7 +237,7 @@ static int cy8ctmg110_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused cy8ctmg110_suspend(struct device *dev)
+static int cy8ctmg110_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cy8ctmg110 *ts = i2c_get_clientdata(client);
@@ -250,7 +250,7 @@ static int __maybe_unused cy8ctmg110_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused cy8ctmg110_resume(struct device *dev)
+static int cy8ctmg110_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cy8ctmg110 *ts = i2c_get_clientdata(client);
@@ -263,7 +263,8 @@ static int __maybe_unused cy8ctmg110_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cy8ctmg110_pm,
+				cy8ctmg110_suspend, cy8ctmg110_resume);
 
 static const struct i2c_device_id cy8ctmg110_idtable[] = {
 	{ CY8CTMG110_DRIVER_NAME, 1 },
@@ -275,7 +276,7 @@ MODULE_DEVICE_TABLE(i2c, cy8ctmg110_idtable);
 static struct i2c_driver cy8ctmg110_driver = {
 	.driver		= {
 		.name	= CY8CTMG110_DRIVER_NAME,
-		.pm	= &cy8ctmg110_pm,
+		.pm	= pm_sleep_ptr(&cy8ctmg110_pm),
 	},
 	.id_table	= cy8ctmg110_idtable,
 	.probe_new	= cy8ctmg110_probe,
-- 
2.39.0


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

* [PATCH 41/69] Input: edt-ft5x06 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (39 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 40/69] Input: cy8ctmg110_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 42/69] Input: eeti_ts " Jonathan Cameron
                   ` (29 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Michael Trimarchi, Dario Binacchi

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 Trimarchi <michael@amarulasolutions.com>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 drivers/input/touchscreen/edt-ft5x06.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index ddd0f1f62458..d09bfeaa7da6 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -1353,7 +1353,7 @@ static void edt_ft5x06_ts_remove(struct i2c_client *client)
 	edt_ft5x06_ts_teardown_debugfs(tsdata);
 }
 
-static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
+static int edt_ft5x06_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
@@ -1396,7 +1396,7 @@ static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev)
+static int edt_ft5x06_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
@@ -1459,8 +1459,8 @@ static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops,
-			 edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops,
+				edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume);
 
 static const struct edt_i2c_chip_data edt_ft5x06_data = {
 	.max_support_points = 5,
@@ -1500,7 +1500,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = {
 	.driver = {
 		.name = "edt_ft5x06",
 		.of_match_table = edt_ft5x06_of_match,
-		.pm = &edt_ft5x06_ts_pm_ops,
+		.pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops),
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.id_table = edt_ft5x06_ts_id,
-- 
2.39.0


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

* [PATCH 42/69] Input: eeti_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (40 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 41/69] Input: edt-ft5x06 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 43/69] Input: egalax_ts " Jonathan Cameron
                   ` (28 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Daniel Mack

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: Daniel Mack <daniel@zonque.org>
---
 drivers/input/touchscreen/eeti_ts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index c8ab03f49227..56fa21688bdb 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -232,7 +232,7 @@ static int eeti_ts_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused eeti_ts_suspend(struct device *dev)
+static int eeti_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct eeti_ts *eeti = i2c_get_clientdata(client);
@@ -251,7 +251,7 @@ static int __maybe_unused eeti_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused eeti_ts_resume(struct device *dev)
+static int eeti_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct eeti_ts *eeti = i2c_get_clientdata(client);
@@ -270,7 +270,7 @@ static int __maybe_unused eeti_ts_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume);
 
 static const struct i2c_device_id eeti_ts_id[] = {
 	{ "eeti_ts", 0 },
@@ -288,7 +288,7 @@ static const struct of_device_id of_eeti_ts_match[] = {
 static struct i2c_driver eeti_ts_driver = {
 	.driver = {
 		.name = "eeti_ts",
-		.pm = &eeti_ts_pm,
+		.pm = pm_sleep_ptr(&eeti_ts_pm),
 		.of_match_table = of_match_ptr(of_eeti_ts_match),
 	},
 	.probe_new = eeti_ts_probe,
-- 
2.39.0


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

* [PATCH 43/69] Input: egalax_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (41 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 42/69] Input: eeti_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 44/69] input: ektf2127 " Jonathan Cameron
                   ` (27 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/egalax_ts.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 742d47a75ac1..1a9805938e6d 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -223,7 +223,7 @@ static const struct i2c_device_id egalax_ts_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, egalax_ts_id);
 
-static int __maybe_unused egalax_ts_suspend(struct device *dev)
+static int egalax_ts_suspend(struct device *dev)
 {
 	static const u8 suspend_cmd[MAX_I2C_DATA_LEN] = {
 		0x3, 0x6, 0xa, 0x3, 0x36, 0x3f, 0x2, 0, 0, 0
@@ -238,7 +238,7 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev)
 	return ret > 0 ? 0 : ret;
 }
 
-static int __maybe_unused egalax_ts_resume(struct device *dev)
+static int egalax_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -248,7 +248,8 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)
 	return egalax_wake_up_device(client);
 }
 
-static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops,
+				egalax_ts_suspend, egalax_ts_resume);
 
 static const struct of_device_id egalax_ts_dt_ids[] = {
 	{ .compatible = "eeti,egalax_ts" },
@@ -259,7 +260,7 @@ MODULE_DEVICE_TABLE(of, egalax_ts_dt_ids);
 static struct i2c_driver egalax_ts_driver = {
 	.driver = {
 		.name	= "egalax_ts",
-		.pm	= &egalax_ts_pm_ops,
+		.pm	= pm_sleep_ptr(&egalax_ts_pm_ops),
 		.of_match_table	= egalax_ts_dt_ids,
 	},
 	.id_table	= egalax_ts_id,
-- 
2.39.0


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

* [PATCH 44/69] input: ektf2127 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (42 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 43/69] Input: egalax_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-09  8:44   ` Hans de Goede
  2023-01-02 18:18 ` [PATCH 45/69] Input: elants_i2c " Jonathan Cameron
                   ` (26 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Jonathan Neuschäfer, Hans de Goede

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: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Cc: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/touchscreen/ektf2127.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
index 328841eaa1b7..e6f1e46d003d 100644
--- a/drivers/input/touchscreen/ektf2127.c
+++ b/drivers/input/touchscreen/ektf2127.c
@@ -177,7 +177,7 @@ static void ektf2127_stop(struct input_dev *dev)
 	gpiod_set_value_cansleep(ts->power_gpios, 0);
 }
 
-static int __maybe_unused ektf2127_suspend(struct device *dev)
+static int ektf2127_suspend(struct device *dev)
 {
 	struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
 
@@ -189,7 +189,7 @@ static int __maybe_unused ektf2127_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ektf2127_resume(struct device *dev)
+static int ektf2127_resume(struct device *dev)
 {
 	struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
 
@@ -201,8 +201,8 @@ static int __maybe_unused ektf2127_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend,
-			 ektf2127_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend,
+				ektf2127_resume);
 
 static int ektf2127_query_dimension(struct i2c_client *client, bool width)
 {
@@ -348,7 +348,7 @@ MODULE_DEVICE_TABLE(i2c, ektf2127_i2c_id);
 static struct i2c_driver ektf2127_driver = {
 	.driver = {
 		.name	= "elan_ektf2127",
-		.pm	= &ektf2127_pm_ops,
+		.pm	= pm_sleep_ptr(&ektf2127_pm_ops),
 		.of_match_table = of_match_ptr(ektf2127_of_match),
 	},
 	.probe_new = ektf2127_probe,
-- 
2.39.0


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

* [PATCH 45/69] Input: elants_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (43 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 44/69] input: ektf2127 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 46/69] Input: goodix " Jonathan Cameron
                   ` (25 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Douglas Anderson

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: Douglas Anderson <dianders@chromium.org>
---
 drivers/input/touchscreen/elants_i2c.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index 5452b50f8a77..8a16eb51481f 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -1572,7 +1572,7 @@ static int elants_i2c_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused elants_i2c_suspend(struct device *dev)
+static int elants_i2c_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct elants_data *ts = i2c_get_clientdata(client);
@@ -1611,7 +1611,7 @@ static int __maybe_unused elants_i2c_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused elants_i2c_resume(struct device *dev)
+static int elants_i2c_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct elants_data *ts = i2c_get_clientdata(client);
@@ -1644,8 +1644,8 @@ static int __maybe_unused elants_i2c_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(elants_i2c_pm_ops,
-			 elants_i2c_suspend, elants_i2c_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(elants_i2c_pm_ops,
+				elants_i2c_suspend, elants_i2c_resume);
 
 static const struct i2c_device_id elants_i2c_id[] = {
 	{ DEVICE_NAME, EKTH3500 },
@@ -1677,7 +1677,7 @@ static struct i2c_driver elants_i2c_driver = {
 	.id_table = elants_i2c_id,
 	.driver = {
 		.name = DEVICE_NAME,
-		.pm = &elants_i2c_pm_ops,
+		.pm = pm_sleep_ptr(&elants_i2c_pm_ops),
 		.acpi_match_table = ACPI_PTR(elants_acpi_id),
 		.of_match_table = of_match_ptr(elants_of_match),
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-- 
2.39.0


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

* [PATCH 46/69] Input: goodix - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (44 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 45/69] Input: elants_i2c " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-09  8:45   ` Hans de Goede
  2023-01-02 18:18 ` [PATCH 47/69] Input: hideep " Jonathan Cameron
                   ` (24 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Hans de Goede, Bastien Nocera

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: Hans de Goede <hdegoede@redhat.com>
Cc: Bastien Nocera <hadess@hadess.net>
---
 drivers/input/touchscreen/goodix.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 8a0a8078de8f..b348172f19c3 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -1401,7 +1401,7 @@ static void goodix_ts_remove(struct i2c_client *client)
 		wait_for_completion(&ts->firmware_loading_complete);
 }
 
-static int __maybe_unused goodix_suspend(struct device *dev)
+static int goodix_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct goodix_ts_data *ts = i2c_get_clientdata(client);
@@ -1448,7 +1448,7 @@ static int __maybe_unused goodix_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused goodix_resume(struct device *dev)
+static int goodix_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct goodix_ts_data *ts = i2c_get_clientdata(client);
@@ -1497,7 +1497,7 @@ static int __maybe_unused goodix_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume);
 
 static const struct i2c_device_id goodix_ts_id[] = {
 	{ "GDIX1001:00", 0 },
@@ -1543,7 +1543,7 @@ static struct i2c_driver goodix_ts_driver = {
 		.name = "Goodix-TS",
 		.acpi_match_table = ACPI_PTR(goodix_acpi_match),
 		.of_match_table = of_match_ptr(goodix_of_match),
-		.pm = &goodix_pm_ops,
+		.pm = pm_sleep_ptr(&goodix_pm_ops),
 	},
 };
 module_i2c_driver(goodix_ts_driver);
-- 
2.39.0


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

* [PATCH 47/69] Input: hideep - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (45 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 46/69] Input: goodix " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 48/69] Input: ilitek_ts_i2c " Jonathan Cameron
                   ` (23 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Anthony Kim

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: Anthony Kim <anthony.kim@hideep.com>
---
 drivers/input/touchscreen/hideep.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c
index ff4bb4c14898..bd454d93f1f7 100644
--- a/drivers/input/touchscreen/hideep.c
+++ b/drivers/input/touchscreen/hideep.c
@@ -959,7 +959,7 @@ static const struct attribute_group hideep_ts_attr_group = {
 	.attrs = hideep_ts_sysfs_entries,
 };
 
-static int __maybe_unused hideep_suspend(struct device *dev)
+static int hideep_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct hideep_ts *ts = i2c_get_clientdata(client);
@@ -970,7 +970,7 @@ static int __maybe_unused hideep_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused hideep_resume(struct device *dev)
+static int hideep_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct hideep_ts *ts = i2c_get_clientdata(client);
@@ -987,7 +987,7 @@ static int __maybe_unused hideep_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume);
 
 static const struct regmap_config hideep_regmap_config = {
 	.reg_bits = 16,
@@ -1108,7 +1108,7 @@ static struct i2c_driver hideep_driver = {
 		.name			= HIDEEP_I2C_NAME,
 		.of_match_table		= of_match_ptr(hideep_match_table),
 		.acpi_match_table	= ACPI_PTR(hideep_acpi_id),
-		.pm			= &hideep_pm_ops,
+		.pm			= pm_sleep_ptr(&hideep_pm_ops),
 	},
 	.id_table	= hideep_i2c_id,
 	.probe_new	= hideep_probe,
-- 
2.39.0


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

* [PATCH 48/69] Input: ilitek_ts_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (46 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 47/69] Input: hideep " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 49/69] Input: imagis " Jonathan Cameron
                   ` (22 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Joe Hung

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: Joe Hung <joe_hung@ilitek.com>
---
 drivers/input/touchscreen/ilitek_ts_i2c.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c
index e6ade3775a8a..d69809338498 100644
--- a/drivers/input/touchscreen/ilitek_ts_i2c.c
+++ b/drivers/input/touchscreen/ilitek_ts_i2c.c
@@ -604,7 +604,7 @@ static int ilitek_ts_i2c_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused ilitek_suspend(struct device *dev)
+static int ilitek_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct ilitek_ts_data *ts = i2c_get_clientdata(client);
@@ -621,7 +621,7 @@ static int __maybe_unused ilitek_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ilitek_resume(struct device *dev)
+static int ilitek_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct ilitek_ts_data *ts = i2c_get_clientdata(client);
@@ -640,7 +640,7 @@ static int __maybe_unused ilitek_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume);
 
 static const struct i2c_device_id ilitek_ts_i2c_id[] = {
 	{ ILITEK_TS_NAME, 0 },
@@ -675,7 +675,7 @@ MODULE_DEVICE_TABLE(of, ilitek_ts_i2c_match);
 static struct i2c_driver ilitek_ts_i2c_driver = {
 	.driver = {
 		.name = ILITEK_TS_NAME,
-		.pm = &ilitek_pm_ops,
+		.pm = pm_sleep_ptr(&ilitek_pm_ops),
 		.of_match_table = of_match_ptr(ilitek_ts_i2c_match),
 		.acpi_match_table = ACPI_PTR(ilitekts_acpi_id),
 	},
-- 
2.39.0


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

* [PATCH 49/69] Input: imagis - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (47 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 48/69] Input: ilitek_ts_i2c " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 50/69] Input: imx6ul_tsc " Jonathan Cameron
                   ` (21 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Markuss Broks

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: Markuss Broks <markuss.broks@gmail.com>
---
 drivers/input/touchscreen/imagis.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c
index e2697e6c6d2a..de1b16e94bb8 100644
--- a/drivers/input/touchscreen/imagis.c
+++ b/drivers/input/touchscreen/imagis.c
@@ -309,7 +309,7 @@ static int imagis_probe(struct i2c_client *i2c)
 	return 0;
 }
 
-static int __maybe_unused imagis_suspend(struct device *dev)
+static int imagis_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct imagis_ts *ts = i2c_get_clientdata(client);
@@ -325,7 +325,7 @@ static int __maybe_unused imagis_suspend(struct device *dev)
 	return retval;
 }
 
-static int __maybe_unused imagis_resume(struct device *dev)
+static int imagis_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct imagis_ts *ts = i2c_get_clientdata(client);
@@ -341,7 +341,7 @@ static int __maybe_unused imagis_resume(struct device *dev)
 	return retval;
 }
 
-static SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id imagis_of_match[] = {
@@ -354,7 +354,7 @@ MODULE_DEVICE_TABLE(of, imagis_of_match);
 static struct i2c_driver imagis_ts_driver = {
 	.driver = {
 		.name = "imagis-touchscreen",
-		.pm = &imagis_pm_ops,
+		.pm = pm_sleep_ptr(&imagis_pm_ops),
 		.of_match_table = of_match_ptr(imagis_of_match),
 	},
 	.probe_new = imagis_probe,
-- 
2.39.0


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

* [PATCH 50/69] Input: imx6ul_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (48 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 49/69] Input: imagis " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 51/69] Input: iqs5xx " Jonathan Cameron
                   ` (20 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Haibo Chen

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: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/input/touchscreen/imx6ul_tsc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
index 2d4facf70cdb..6ac8fa84ed9f 100644
--- a/drivers/input/touchscreen/imx6ul_tsc.c
+++ b/drivers/input/touchscreen/imx6ul_tsc.c
@@ -512,7 +512,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused imx6ul_tsc_suspend(struct device *dev)
+static int imx6ul_tsc_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct imx6ul_tsc *tsc = platform_get_drvdata(pdev);
@@ -528,7 +528,7 @@ static int __maybe_unused imx6ul_tsc_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused imx6ul_tsc_resume(struct device *dev)
+static int imx6ul_tsc_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct imx6ul_tsc *tsc = platform_get_drvdata(pdev);
@@ -545,8 +545,8 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev)
 	return retval;
 }
 
-static SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops,
-			 imx6ul_tsc_suspend, imx6ul_tsc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops,
+				imx6ul_tsc_suspend, imx6ul_tsc_resume);
 
 static const struct of_device_id imx6ul_tsc_match[] = {
 	{ .compatible = "fsl,imx6ul-tsc", },
@@ -558,7 +558,7 @@ static struct platform_driver imx6ul_tsc_driver = {
 	.driver		= {
 		.name	= "imx6ul-tsc",
 		.of_match_table	= imx6ul_tsc_match,
-		.pm	= &imx6ul_tsc_pm_ops,
+		.pm	= pm_sleep_ptr(&imx6ul_tsc_pm_ops),
 	},
 	.probe		= imx6ul_tsc_probe,
 };
-- 
2.39.0


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

* [PATCH 51/69] Input: iqs5xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (49 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 50/69] Input: imx6ul_tsc " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-03 18:15   ` Jeff LaBundy
  2023-01-02 18:18 ` [PATCH 52/69] Input: mcs5000_ts " Jonathan Cameron
                   ` (19 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Jeff LaBundy

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: Jeff LaBundy <jeff@labundy.com>
---
 drivers/input/touchscreen/iqs5xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
index dc3137a34f35..c73e9c5c0077 100644
--- a/drivers/input/touchscreen/iqs5xx.c
+++ b/drivers/input/touchscreen/iqs5xx.c
@@ -979,7 +979,7 @@ static const struct attribute_group iqs5xx_attr_group = {
 	.attrs = iqs5xx_attrs,
 };
 
-static int __maybe_unused iqs5xx_suspend(struct device *dev)
+static int iqs5xx_suspend(struct device *dev)
 {
 	struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
 	struct input_dev *input = iqs5xx->input;
@@ -998,7 +998,7 @@ static int __maybe_unused iqs5xx_suspend(struct device *dev)
 	return error;
 }
 
-static int __maybe_unused iqs5xx_resume(struct device *dev)
+static int iqs5xx_resume(struct device *dev)
 {
 	struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
 	struct input_dev *input = iqs5xx->input;
@@ -1017,7 +1017,7 @@ static int __maybe_unused iqs5xx_resume(struct device *dev)
 	return error;
 }
 
-static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
 
 static int iqs5xx_probe(struct i2c_client *client)
 {
@@ -1090,7 +1090,7 @@ static struct i2c_driver iqs5xx_i2c_driver = {
 	.driver = {
 		.name		= "iqs5xx",
 		.of_match_table	= iqs5xx_of_match,
-		.pm		= &iqs5xx_pm,
+		.pm		= pm_sleep_ptr(&iqs5xx_pm),
 	},
 	.id_table	= iqs5xx_id,
 	.probe_new	= iqs5xx_probe,
-- 
2.39.0


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

* [PATCH 52/69] Input: mcs5000_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (50 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 51/69] Input: iqs5xx " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 53/69] Input: melfas_mip4 " Jonathan Cameron
                   ` (18 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/mcs5000_ts.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c
index ea9517cad695..704e36087ca2 100644
--- a/drivers/input/touchscreen/mcs5000_ts.c
+++ b/drivers/input/touchscreen/mcs5000_ts.c
@@ -241,7 +241,7 @@ static int mcs5000_ts_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused mcs5000_ts_suspend(struct device *dev)
+static int mcs5000_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -251,7 +251,7 @@ static int __maybe_unused mcs5000_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mcs5000_ts_resume(struct device *dev)
+static int mcs5000_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mcs5000_ts_data *data = i2c_get_clientdata(client);
@@ -262,7 +262,8 @@ static int __maybe_unused mcs5000_ts_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mcs5000_ts_pm,
+				mcs5000_ts_suspend, mcs5000_ts_resume);
 
 static const struct i2c_device_id mcs5000_ts_id[] = {
 	{ "mcs5000_ts", 0 },
@@ -274,7 +275,7 @@ static struct i2c_driver mcs5000_ts_driver = {
 	.probe_new	= mcs5000_ts_probe,
 	.driver = {
 		.name = "mcs5000_ts",
-		.pm   = &mcs5000_ts_pm,
+		.pm   = pm_sleep_ptr(&mcs5000_ts_pm),
 	},
 	.id_table	= mcs5000_ts_id,
 };
-- 
2.39.0


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

* [PATCH 53/69] Input: melfas_mip4 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (51 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 52/69] Input: mcs5000_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 54/69] input: migor_ts " Jonathan Cameron
                   ` (17 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Sangwon Jee

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: Sangwon Jee <jeesw@melfas.com>
---
 drivers/input/touchscreen/melfas_mip4.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index 4ee8ed4c930c..acdfbdea2b6e 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -1528,7 +1528,7 @@ static int mip4_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused mip4_suspend(struct device *dev)
+static int mip4_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mip4_ts *ts = i2c_get_clientdata(client);
@@ -1546,7 +1546,7 @@ static int __maybe_unused mip4_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mip4_resume(struct device *dev)
+static int mip4_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mip4_ts *ts = i2c_get_clientdata(client);
@@ -1564,7 +1564,7 @@ static int __maybe_unused mip4_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mip4_pm_ops, mip4_suspend, mip4_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mip4_pm_ops, mip4_suspend, mip4_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id mip4_of_match[] = {
@@ -1595,7 +1595,7 @@ static struct i2c_driver mip4_driver = {
 		.name = MIP4_DEVICE_NAME,
 		.of_match_table = of_match_ptr(mip4_of_match),
 		.acpi_match_table = ACPI_PTR(mip4_acpi_match),
-		.pm = &mip4_pm_ops,
+		.pm = pm_sleep_ptr(&mip4_pm_ops),
 	},
 };
 module_i2c_driver(mip4_driver);
-- 
2.39.0


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

* [PATCH 54/69] input: migor_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (52 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 53/69] Input: melfas_mip4 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 55/69] Input: mms114 " Jonathan Cameron
                   ` (16 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/migor_ts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c
index ff0f605f3a3a..69fcc88d4f80 100644
--- a/drivers/input/touchscreen/migor_ts.c
+++ b/drivers/input/touchscreen/migor_ts.c
@@ -186,7 +186,7 @@ static void migor_ts_remove(struct i2c_client *client)
 	dev_set_drvdata(&client->dev, NULL);
 }
 
-static int __maybe_unused migor_ts_suspend(struct device *dev)
+static int migor_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct migor_ts_priv *priv = i2c_get_clientdata(client);
@@ -197,7 +197,7 @@ static int __maybe_unused migor_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused migor_ts_resume(struct device *dev)
+static int migor_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct migor_ts_priv *priv = i2c_get_clientdata(client);
@@ -208,7 +208,7 @@ static int __maybe_unused migor_ts_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume);
 
 static const struct i2c_device_id migor_ts_id[] = {
 	{ "migor_ts", 0 },
@@ -219,7 +219,7 @@ MODULE_DEVICE_TABLE(i2c, migor_ts_id);
 static struct i2c_driver migor_ts_driver = {
 	.driver = {
 		.name = "migor_ts",
-		.pm = &migor_ts_pm,
+		.pm = pm_sleep_ptr(&migor_ts_pm),
 	},
 	.probe_new = migor_ts_probe,
 	.remove = migor_ts_remove,
-- 
2.39.0


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

* [PATCH 55/69] Input: mms114 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (53 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 54/69] input: migor_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 56/69] Input: msg2638 " Jonathan Cameron
                   ` (15 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/mms114.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index 758b669391a7..4dbca1aad89d 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -557,7 +557,7 @@ static int mms114_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused mms114_suspend(struct device *dev)
+static int mms114_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mms114_data *data = i2c_get_clientdata(client);
@@ -581,7 +581,7 @@ static int __maybe_unused mms114_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mms114_resume(struct device *dev)
+static int mms114_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mms114_data *data = i2c_get_clientdata(client);
@@ -601,7 +601,7 @@ static int __maybe_unused mms114_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume);
 
 static const struct i2c_device_id mms114_id[] = {
 	{ "mms114", 0 },
@@ -635,7 +635,7 @@ MODULE_DEVICE_TABLE(of, mms114_dt_match);
 static struct i2c_driver mms114_driver = {
 	.driver = {
 		.name	= "mms114",
-		.pm	= &mms114_pm_ops,
+		.pm	= pm_sleep_ptr(&mms114_pm_ops),
 		.of_match_table = of_match_ptr(mms114_dt_match),
 	},
 	.probe_new	= mms114_probe,
-- 
2.39.0


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

* [PATCH 56/69] Input: msg2638 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (54 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 55/69] Input: mms114 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 57/69] Input: pixcir_i2c_ts " Jonathan Cameron
                   ` (14 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Vincent Knecht

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: Vincent Knecht <vincent.knecht@mailoo.org>
---
 drivers/input/touchscreen/msg2638.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/msg2638.c b/drivers/input/touchscreen/msg2638.c
index 4c0816b09d33..b23db689d995 100644
--- a/drivers/input/touchscreen/msg2638.c
+++ b/drivers/input/touchscreen/msg2638.c
@@ -441,7 +441,7 @@ static int msg2638_ts_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused msg2638_suspend(struct device *dev)
+static int msg2638_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client);
@@ -456,7 +456,7 @@ static int __maybe_unused msg2638_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused msg2638_resume(struct device *dev)
+static int msg2638_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client);
@@ -472,7 +472,7 @@ static int __maybe_unused msg2638_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume);
 
 static const struct msg_chip_data msg2138_data = {
 	.irq_handler = msg2138_ts_irq_handler,
@@ -495,7 +495,7 @@ static struct i2c_driver msg2638_ts_driver = {
 	.probe_new = msg2638_ts_probe,
 	.driver = {
 		.name = "MStar-TS",
-		.pm = &msg2638_pm_ops,
+		.pm = pm_sleep_ptr(&msg2638_pm_ops),
 		.of_match_table = msg2638_of_match,
 	},
 };
-- 
2.39.0


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

* [PATCH 57/69] Input: pixcir_i2c_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (55 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 56/69] Input: msg2638 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 58/69] Input: raydium_i2c_ts " Jonathan Cameron
                   ` (13 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Fabio Estevam

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: Fabio Estevam <festevam@gmail.com>
---
 drivers/input/touchscreen/pixcir_i2c_ts.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index 7959947a3458..f09f4831bad4 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -405,7 +405,7 @@ static void pixcir_input_close(struct input_dev *dev)
 	pixcir_stop(ts);
 }
 
-static int __maybe_unused pixcir_i2c_ts_suspend(struct device *dev)
+static int pixcir_i2c_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client);
@@ -432,7 +432,7 @@ static int __maybe_unused pixcir_i2c_ts_suspend(struct device *dev)
 	return ret;
 }
 
-static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev)
+static int pixcir_i2c_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client);
@@ -459,8 +459,8 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops,
-			 pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops,
+				pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume);
 
 static int pixcir_i2c_ts_probe(struct i2c_client *client)
 {
@@ -614,7 +614,7 @@ MODULE_DEVICE_TABLE(of, pixcir_of_match);
 static struct i2c_driver pixcir_i2c_ts_driver = {
 	.driver = {
 		.name	= "pixcir_ts",
-		.pm	= &pixcir_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&pixcir_dev_pm_ops),
 		.of_match_table = of_match_ptr(pixcir_of_match),
 	},
 	.probe_new	= pixcir_i2c_ts_probe,
-- 
2.39.0


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

* [PATCH 58/69] Input: raydium_i2c_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (56 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 57/69] Input: pixcir_i2c_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 59/69] Input: silead " Jonathan Cameron
                   ` (12 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/raydium_i2c_ts.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index d690a17240c2..49a06d3876cf 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -1197,7 +1197,7 @@ static int raydium_i2c_probe(struct i2c_client *client)
 	return 0;
 }
 
-static void __maybe_unused raydium_enter_sleep(struct i2c_client *client)
+static void raydium_enter_sleep(struct i2c_client *client)
 {
 	static const u8 sleep_cmd[] = { 0x5A, 0xff, 0x00, 0x0f };
 	int error;
@@ -1209,7 +1209,7 @@ static void __maybe_unused raydium_enter_sleep(struct i2c_client *client)
 			"sleep command failed: %d\n", error);
 }
 
-static int __maybe_unused raydium_i2c_suspend(struct device *dev)
+static int raydium_i2c_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct raydium_data *ts = i2c_get_clientdata(client);
@@ -1229,7 +1229,7 @@ static int __maybe_unused raydium_i2c_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused raydium_i2c_resume(struct device *dev)
+static int raydium_i2c_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct raydium_data *ts = i2c_get_clientdata(client);
@@ -1246,8 +1246,8 @@ static int __maybe_unused raydium_i2c_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(raydium_i2c_pm_ops,
-			 raydium_i2c_suspend, raydium_i2c_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(raydium_i2c_pm_ops,
+				raydium_i2c_suspend, raydium_i2c_resume);
 
 static const struct i2c_device_id raydium_i2c_id[] = {
 	{ "raydium_i2c", 0 },
@@ -1277,7 +1277,7 @@ static struct i2c_driver raydium_i2c_driver = {
 	.id_table = raydium_i2c_id,
 	.driver = {
 		.name = "raydium_ts",
-		.pm = &raydium_i2c_pm_ops,
+		.pm = pm_sleep_ptr(&raydium_i2c_pm_ops),
 		.acpi_match_table = ACPI_PTR(raydium_acpi_id),
 		.of_match_table = of_match_ptr(raydium_of_match),
 	},
-- 
2.39.0


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

* [PATCH 59/69] Input: silead - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (57 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 58/69] Input: raydium_i2c_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-09  8:45   ` Hans de Goede
  2023-01-02 18:18 ` [PATCH 60/69] Input: st1232 " Jonathan Cameron
                   ` (11 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Hans de Goede

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: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/touchscreen/silead.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index 8a7351c4414c..a37fac089010 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -736,7 +736,7 @@ static int silead_ts_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused silead_ts_suspend(struct device *dev)
+static int silead_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -745,7 +745,7 @@ static int __maybe_unused silead_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused silead_ts_resume(struct device *dev)
+static int silead_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	bool second_try = false;
@@ -784,7 +784,7 @@ static int __maybe_unused silead_ts_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume);
 
 static const struct i2c_device_id silead_ts_id[] = {
 	{ "gsl1680", 0 },
@@ -832,7 +832,7 @@ static struct i2c_driver silead_ts_driver = {
 		.name = SILEAD_TS_NAME,
 		.acpi_match_table = ACPI_PTR(silead_ts_acpi_match),
 		.of_match_table = of_match_ptr(silead_ts_of_match),
-		.pm = &silead_ts_pm,
+		.pm = pm_sleep_ptr(&silead_ts_pm),
 	},
 };
 module_i2c_driver(silead_ts_driver);
-- 
2.39.0


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

* [PATCH 60/69] Input: st1232 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (58 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 59/69] Input: silead " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 61/69] Input: surface3_spi " Jonathan Cameron
                   ` (10 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, John Keeping

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: John Keeping <john@metanate.com>
---
 drivers/input/touchscreen/st1232.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index bd68633dc6c0..f49566dc96f8 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -340,7 +340,7 @@ static int st1232_ts_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused st1232_ts_suspend(struct device *dev)
+static int st1232_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct st1232_ts_data *ts = i2c_get_clientdata(client);
@@ -353,7 +353,7 @@ static int __maybe_unused st1232_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused st1232_ts_resume(struct device *dev)
+static int st1232_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct st1232_ts_data *ts = i2c_get_clientdata(client);
@@ -366,8 +366,8 @@ static int __maybe_unused st1232_ts_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops,
-			 st1232_ts_suspend, st1232_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops,
+				st1232_ts_suspend, st1232_ts_resume);
 
 static const struct i2c_device_id st1232_ts_id[] = {
 	{ ST1232_TS_NAME, (unsigned long)&st1232_chip_info },
@@ -390,7 +390,7 @@ static struct i2c_driver st1232_ts_driver = {
 		.name	= ST1232_TS_NAME,
 		.of_match_table = st1232_ts_dt_ids,
 		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &st1232_ts_pm_ops,
+		.pm	= pm_sleep_ptr(&st1232_ts_pm_ops),
 	},
 };
 
-- 
2.39.0


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

* [PATCH 61/69] Input: surface3_spi - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (59 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 60/69] Input: st1232 " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 62/69] Input: ti_am335x_tsc " Jonathan Cameron
                   ` (9 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Stephen Just, Benjamin Tissoires

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 Just <stephenjust@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
 drivers/input/touchscreen/surface3_spi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
index 1da23e5585a0..31d140248f2e 100644
--- a/drivers/input/touchscreen/surface3_spi.c
+++ b/drivers/input/touchscreen/surface3_spi.c
@@ -369,7 +369,7 @@ static int surface3_spi_probe(struct spi_device *spi)
 	return 0;
 }
 
-static int __maybe_unused surface3_spi_suspend(struct device *dev)
+static int surface3_spi_suspend(struct device *dev)
 {
 	struct spi_device *spi = to_spi_device(dev);
 	struct surface3_ts_data *data = spi_get_drvdata(spi);
@@ -381,7 +381,7 @@ static int __maybe_unused surface3_spi_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused surface3_spi_resume(struct device *dev)
+static int surface3_spi_resume(struct device *dev)
 {
 	struct spi_device *spi = to_spi_device(dev);
 	struct surface3_ts_data *data = spi_get_drvdata(spi);
@@ -393,9 +393,9 @@ static int __maybe_unused surface3_spi_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops,
-			 surface3_spi_suspend,
-			 surface3_spi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops,
+				surface3_spi_suspend,
+				surface3_spi_resume);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id surface3_spi_acpi_match[] = {
@@ -409,7 +409,7 @@ static struct spi_driver surface3_spi_driver = {
 	.driver = {
 		.name	= "Surface3-spi",
 		.acpi_match_table = ACPI_PTR(surface3_spi_acpi_match),
-		.pm = &surface3_spi_pm_ops,
+		.pm = pm_sleep_ptr(&surface3_spi_pm_ops),
 	},
 	.probe = surface3_spi_probe,
 };
-- 
2.39.0


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

* [PATCH 62/69] Input: ti_am335x_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (60 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 61/69] Input: surface3_spi " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 63/69] Input: ucb1400_ts " Jonathan Cameron
                   ` (8 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Dario Binacchi

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: Dario Binacchi <dariobin@libero.it>
---
 drivers/input/touchscreen/ti_am335x_tsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index f2fb6a9a1a57..decf2d24a115 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -512,7 +512,7 @@ static int titsc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused titsc_suspend(struct device *dev)
+static int titsc_suspend(struct device *dev)
 {
 	struct titsc *ts_dev = dev_get_drvdata(dev);
 	unsigned int idle;
@@ -527,7 +527,7 @@ static int __maybe_unused titsc_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused titsc_resume(struct device *dev)
+static int titsc_resume(struct device *dev)
 {
 	struct titsc *ts_dev = dev_get_drvdata(dev);
 
@@ -543,7 +543,7 @@ static int __maybe_unused titsc_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume);
 
 static const struct of_device_id ti_tsc_dt_ids[] = {
 	{ .compatible = "ti,am3359-tsc", },
@@ -556,7 +556,7 @@ static struct platform_driver ti_tsc_driver = {
 	.remove	= titsc_remove,
 	.driver	= {
 		.name   = "TI-am335x-tsc",
-		.pm	= &titsc_pm_ops,
+		.pm	= pm_sleep_ptr(&titsc_pm_ops),
 		.of_match_table = ti_tsc_dt_ids,
 	},
 };
-- 
2.39.0


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

* [PATCH 63/69] Input: ucb1400_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (61 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 62/69] Input: ti_am335x_tsc " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 64/69] Input: wacom_i2c " Jonathan Cameron
                   ` (7 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/ucb1400_ts.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index dfd3b35590c3..1b3d1df231bb 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -401,7 +401,7 @@ static int ucb1400_ts_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused ucb1400_ts_suspend(struct device *dev)
+static int ucb1400_ts_suspend(struct device *dev)
 {
 	struct ucb1400_ts *ucb = dev_get_platdata(dev);
 	struct input_dev *idev = ucb->ts_idev;
@@ -415,7 +415,7 @@ static int __maybe_unused ucb1400_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ucb1400_ts_resume(struct device *dev)
+static int ucb1400_ts_resume(struct device *dev)
 {
 	struct ucb1400_ts *ucb = dev_get_platdata(dev);
 	struct input_dev *idev = ucb->ts_idev;
@@ -429,15 +429,15 @@ static int __maybe_unused ucb1400_ts_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ucb1400_ts_pm_ops,
-			 ucb1400_ts_suspend, ucb1400_ts_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ucb1400_ts_pm_ops,
+				ucb1400_ts_suspend, ucb1400_ts_resume);
 
 static struct platform_driver ucb1400_ts_driver = {
 	.probe	= ucb1400_ts_probe,
 	.remove	= ucb1400_ts_remove,
 	.driver	= {
 		.name	= "ucb1400_ts",
-		.pm	= &ucb1400_ts_pm_ops,
+		.pm	= pm_sleep_ptr(&ucb1400_ts_pm_ops),
 	},
 };
 module_platform_driver(ucb1400_ts_driver);
-- 
2.39.0


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

* [PATCH 64/69] Input: wacom_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (62 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 63/69] Input: ucb1400_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-03 10:39   ` Alistair
  2023-01-02 18:18 ` [PATCH 65/69] Input: wdt87xx_i2c " Jonathan Cameron
                   ` (6 subsequent siblings)
  70 siblings, 1 reply; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Alistair Francis

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: Alistair Francis <alistair@alistair23.me>
---
 drivers/input/touchscreen/wacom_i2c.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index c9188ee00c62..a145b9105255 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -232,7 +232,7 @@ static int wacom_i2c_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused wacom_i2c_suspend(struct device *dev)
+static int wacom_i2c_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -241,7 +241,7 @@ static int __maybe_unused wacom_i2c_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused wacom_i2c_resume(struct device *dev)
+static int wacom_i2c_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -250,7 +250,7 @@ static int __maybe_unused wacom_i2c_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume);
 
 static const struct i2c_device_id wacom_i2c_id[] = {
 	{ "WAC_I2C_EMR", 0 },
@@ -261,7 +261,7 @@ MODULE_DEVICE_TABLE(i2c, wacom_i2c_id);
 static struct i2c_driver wacom_i2c_driver = {
 	.driver	= {
 		.name	= "wacom_i2c",
-		.pm	= &wacom_i2c_pm,
+		.pm	= pm_sleep_ptr(&wacom_i2c_pm),
 	},
 
 	.probe_new	= wacom_i2c_probe,
-- 
2.39.0


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

* [PATCH 65/69] Input: wdt87xx_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (63 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 64/69] Input: wacom_i2c " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 66/69] Input: wm97xx " Jonathan Cameron
                   ` (5 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/wdt87xx_i2c.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
index 3f87db5cdca4..771962af3d0a 100644
--- a/drivers/input/touchscreen/wdt87xx_i2c.c
+++ b/drivers/input/touchscreen/wdt87xx_i2c.c
@@ -1113,7 +1113,7 @@ static int wdt87xx_ts_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused wdt87xx_suspend(struct device *dev)
+static int wdt87xx_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	int error;
@@ -1132,7 +1132,7 @@ static int __maybe_unused wdt87xx_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused wdt87xx_resume(struct device *dev)
+static int wdt87xx_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	int error;
@@ -1154,7 +1154,7 @@ static int __maybe_unused wdt87xx_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(wdt87xx_pm_ops, wdt87xx_suspend, wdt87xx_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(wdt87xx_pm_ops, wdt87xx_suspend, wdt87xx_resume);
 
 static const struct i2c_device_id wdt87xx_dev_id[] = {
 	{ WDT87XX_NAME, 0 },
@@ -1173,7 +1173,7 @@ static struct i2c_driver wdt87xx_driver = {
 	.id_table	= wdt87xx_dev_id,
 	.driver	= {
 		.name	= WDT87XX_NAME,
-		.pm     = &wdt87xx_pm_ops,
+		.pm     = pm_sleep_ptr(&wdt87xx_pm_ops),
 		.acpi_match_table = ACPI_PTR(wdt87xx_acpi_id),
 	},
 };
-- 
2.39.0


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

* [PATCH 66/69] Input: wm97xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (64 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 65/69] Input: wdt87xx_i2c " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 67/69] Input: zforce_ts " Jonathan Cameron
                   ` (4 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/wm97xx-core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index f51ab5614532..ac3b3dd59488 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -763,7 +763,7 @@ static int wm97xx_mfd_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused wm97xx_suspend(struct device *dev)
+static int wm97xx_suspend(struct device *dev)
 {
 	struct wm97xx *wm = dev_get_drvdata(dev);
 	u16 reg;
@@ -797,7 +797,7 @@ static int __maybe_unused wm97xx_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused wm97xx_resume(struct device *dev)
+static int wm97xx_resume(struct device *dev)
 {
 	struct wm97xx *wm = dev_get_drvdata(dev);
 
@@ -833,7 +833,7 @@ static int __maybe_unused wm97xx_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume);
 
 /*
  * Machine specific operations
@@ -869,13 +869,13 @@ static struct device_driver wm97xx_driver = {
 	.owner =	THIS_MODULE,
 	.probe =	wm97xx_probe,
 	.remove =	wm97xx_remove,
-	.pm =		&wm97xx_pm_ops,
+	.pm =		pm_sleep_ptr(&wm97xx_pm_ops),
 };
 
 static struct platform_driver wm97xx_mfd_driver = {
 	.driver = {
 		.name =		"wm97xx-ts",
-		.pm =		&wm97xx_pm_ops,
+		.pm =		pm_sleep_ptr(&wm97xx_pm_ops),
 	},
 	.probe =	wm97xx_mfd_probe,
 	.remove =	wm97xx_mfd_remove,
-- 
2.39.0


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

* [PATCH 67/69] Input: zforce_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (65 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 66/69] Input: wm97xx " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 68/69] Input: zinitix " Jonathan Cameron
                   ` (3 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/zforce_ts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 24e78ca83fa3..76b194285e1c 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -608,7 +608,7 @@ static void zforce_input_close(struct input_dev *dev)
 	return;
 }
 
-static int __maybe_unused zforce_suspend(struct device *dev)
+static int zforce_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct zforce_ts *ts = i2c_get_clientdata(client);
@@ -653,7 +653,7 @@ static int __maybe_unused zforce_suspend(struct device *dev)
 	return ret;
 }
 
-static int __maybe_unused zforce_resume(struct device *dev)
+static int zforce_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct zforce_ts *ts = i2c_get_clientdata(client);
@@ -691,7 +691,7 @@ static int __maybe_unused zforce_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume);
 
 static void zforce_reset(void *data)
 {
@@ -941,7 +941,7 @@ MODULE_DEVICE_TABLE(of, zforce_dt_idtable);
 static struct i2c_driver zforce_driver = {
 	.driver = {
 		.name	= "zforce-ts",
-		.pm	= &zforce_pm_ops,
+		.pm	= pm_sleep_ptr(&zforce_pm_ops),
 		.of_match_table	= of_match_ptr(zforce_dt_idtable),
 	},
 	.probe_new	= zforce_probe,
-- 
2.39.0


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

* [PATCH 68/69] Input: zinitix - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (66 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 67/69] Input: zforce_ts " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-02 18:18 ` [PATCH 69/69] Input: ipaq-micro-ts - use " Jonathan Cameron
                   ` (2 subsequent siblings)
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 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/touchscreen/zinitix.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscreen/zinitix.c
index 52f9e9eaab14..cdf9bcd744db 100644
--- a/drivers/input/touchscreen/zinitix.c
+++ b/drivers/input/touchscreen/zinitix.c
@@ -562,7 +562,7 @@ static int zinitix_ts_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused zinitix_suspend(struct device *dev)
+static int zinitix_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct bt541_ts_data *bt541 = i2c_get_clientdata(client);
@@ -577,7 +577,7 @@ static int __maybe_unused zinitix_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused zinitix_resume(struct device *dev)
+static int zinitix_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct bt541_ts_data *bt541 = i2c_get_clientdata(client);
@@ -593,7 +593,7 @@ static int __maybe_unused zinitix_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id zinitix_of_match[] = {
@@ -620,7 +620,7 @@ static struct i2c_driver zinitix_ts_driver = {
 	.probe_new = zinitix_ts_probe,
 	.driver = {
 		.name = "Zinitix-TS",
-		.pm = &zinitix_pm_ops,
+		.pm = pm_sleep_ptr(&zinitix_pm_ops),
 		.of_match_table = of_match_ptr(zinitix_of_match),
 	},
 };
-- 
2.39.0


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

* [PATCH 69/69] Input: ipaq-micro-ts - use DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (67 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 68/69] Input: zinitix " Jonathan Cameron
@ 2023-01-02 18:18 ` Jonathan Cameron
  2023-01-04  0:01 ` [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Linus Walleij
  2023-01-11  0:54 ` Dmitry Torokhov
  70 siblings, 0 replies; 89+ messages in thread
From: Jonathan Cameron @ 2023-01-02 18:18 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron, Linus Walleij

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

This driver never used the older SIMPLE_DEV_PM_OPS() but instead just
set two of the callbacks directly.  Skip that deprecated macro and go
straight to the new form that avoids the need for guarding or marking
callbacks __maybe_unused.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
--
It is possible there is some subtle reason why only two of the
callbacks normally set by SIMPLE_DEV_PM_OPS() are set. As such,
this one needs some closer reading than many of the others.
---
 drivers/input/touchscreen/ipaq-micro-ts.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/ipaq-micro-ts.c b/drivers/input/touchscreen/ipaq-micro-ts.c
index 0eb5689fe65f..d8e25b502968 100644
--- a/drivers/input/touchscreen/ipaq-micro-ts.c
+++ b/drivers/input/touchscreen/ipaq-micro-ts.c
@@ -119,7 +119,7 @@ static int micro_ts_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused micro_ts_suspend(struct device *dev)
+static int micro_ts_suspend(struct device *dev)
 {
 	struct touchscreen_data *ts = dev_get_drvdata(dev);
 
@@ -128,7 +128,7 @@ static int __maybe_unused micro_ts_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused micro_ts_resume(struct device *dev)
+static int micro_ts_resume(struct device *dev)
 {
 	struct touchscreen_data *ts = dev_get_drvdata(dev);
 	struct input_dev *input = ts->input;
@@ -143,14 +143,13 @@ static int __maybe_unused micro_ts_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops micro_ts_dev_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(micro_ts_suspend, micro_ts_resume)
-};
+static DEFINE_SIMPLE_DEV_PM(micro_ts_dev_pm_ops,
+			    micro_ts_suspend, micro_ts_resume);
 
 static struct platform_driver micro_ts_device_driver = {
 	.driver	= {
 		.name	= "ipaq-micro-ts",
-		.pm	= &micro_ts_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&micro_ts_dev_pm_ops),
 	},
 	.probe	= micro_ts_probe,
 };
-- 
2.39.0


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

* Re: [PATCH 07/69] Input: gpio-vibra - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 ` [PATCH 07/69] Input: gpio-vibra " Jonathan Cameron
@ 2023-01-02 19:30   ` Luca Weiss
  0 siblings, 0 replies; 89+ messages in thread
From: Luca Weiss @ 2023-01-02 19:30 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Jonathan Cameron; +Cc: Jonathan Cameron

On Montag, 2. Jänner 2023 19:17:40 CET 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>
> Cc: Luca Weiss <luca@z3ntu.xyz>

Reviewed-by: Luca Weiss <luca@z3ntu.xyz>

Thanks!

> ---
>  drivers/input/misc/gpio-vibra.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/misc/gpio-vibra.c
> b/drivers/input/misc/gpio-vibra.c index f79f75595dd7..134a1309ba92 100644
> --- a/drivers/input/misc/gpio-vibra.c
> +++ b/drivers/input/misc/gpio-vibra.c
> @@ -157,7 +157,7 @@ static int gpio_vibrator_probe(struct platform_device
> *pdev) return 0;
>  }
> 
> -static int __maybe_unused gpio_vibrator_suspend(struct device *dev)
> +static int gpio_vibrator_suspend(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct gpio_vibrator *vibrator = platform_get_drvdata(pdev);
> @@ -169,7 +169,7 @@ static int __maybe_unused gpio_vibrator_suspend(struct
> device *dev) return 0;
>  }
> 
> -static int __maybe_unused gpio_vibrator_resume(struct device *dev)
> +static int gpio_vibrator_resume(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct gpio_vibrator *vibrator = platform_get_drvdata(pdev);
> @@ -180,8 +180,8 @@ static int __maybe_unused gpio_vibrator_resume(struct
> device *dev) return 0;
>  }
> 
> -static SIMPLE_DEV_PM_OPS(gpio_vibrator_pm_ops,
> -			 gpio_vibrator_suspend, gpio_vibrator_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(gpio_vibrator_pm_ops,
> +				gpio_vibrator_suspend, 
gpio_vibrator_resume);
> 
>  #ifdef CONFIG_OF
>  static const struct of_device_id gpio_vibra_dt_match_table[] = {
> @@ -195,7 +195,7 @@ static struct platform_driver gpio_vibrator_driver = {
>  	.probe	= gpio_vibrator_probe,
>  	.driver	= {
>  		.name	= "gpio-vibrator",
> -		.pm	= &gpio_vibrator_pm_ops,
> +		.pm	= pm_sleep_ptr(&gpio_vibrator_pm_ops),
>  		.of_match_table = of_match_ptr(gpio_vibra_dt_match_table),
>  	},
>  };





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

* Re: [PATCH 11/69] Input: max77693-haptic - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 ` [PATCH 11/69] Input: max77693-haptic " Jonathan Cameron
@ 2023-01-03  7:54   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 89+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-03  7:54 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

On 02/01/2023 19:17, 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>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 33/69] Input: atmel_mxt_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 33/69] Input: atmel_mxt_ts " Jonathan Cameron
@ 2023-01-03  8:45   ` Claudiu.Beznea
  0 siblings, 0 replies; 89+ messages in thread
From: Claudiu.Beznea @ 2023-01-03  8:45 UTC (permalink / raw)
  To: jic23, linux-input, dmitry.torokhov
  Cc: Jonathan.Cameron, Nicolas.Ferre, alexandre.belloni

On 02.01.2023 20:18, Jonathan Cameron wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> 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: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Claudiu Beznea <claudiu.beznea@microchip.com>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>


> ---
>  drivers/input/touchscreen/atmel_mxt_ts.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 39ef2664b852..996bf434e1cb 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -3296,7 +3296,7 @@ static void mxt_remove(struct i2c_client *client)
>                                data->regulators);
>  }
> 
> -static int __maybe_unused mxt_suspend(struct device *dev)
> +static int mxt_suspend(struct device *dev)
>  {
>         struct i2c_client *client = to_i2c_client(dev);
>         struct mxt_data *data = i2c_get_clientdata(client);
> @@ -3317,7 +3317,7 @@ static int __maybe_unused mxt_suspend(struct device *dev)
>         return 0;
>  }
> 
> -static int __maybe_unused mxt_resume(struct device *dev)
> +static int mxt_resume(struct device *dev)
>  {
>         struct i2c_client *client = to_i2c_client(dev);
>         struct mxt_data *data = i2c_get_clientdata(client);
> @@ -3338,7 +3338,7 @@ static int __maybe_unused mxt_resume(struct device *dev)
>         return 0;
>  }
> 
> -static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
> 
>  static const struct of_device_id mxt_of_match[] = {
>         { .compatible = "atmel,maxtouch", },
> @@ -3375,7 +3375,7 @@ static struct i2c_driver mxt_driver = {
>                 .name   = "atmel_mxt_ts",
>                 .of_match_table = mxt_of_match,
>                 .acpi_match_table = ACPI_PTR(mxt_acpi_id),
> -               .pm     = &mxt_pm_ops,
> +               .pm     = pm_sleep_ptr(&mxt_pm_ops),
>         },
>         .probe_new      = mxt_probe,
>         .remove         = mxt_remove,
> --
> 2.39.0
> 


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

* Re: [PATCH 64/69] Input: wacom_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 64/69] Input: wacom_i2c " Jonathan Cameron
@ 2023-01-03 10:39   ` Alistair
  0 siblings, 0 replies; 89+ messages in thread
From: Alistair @ 2023-01-03 10:39 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

On Tue, 3 Jan 2023, at 4:18 AM, 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>
> Cc: Alistair Francis <alistair@alistair23.me>

Reviewed-by: Alistair Francis <alistair@alistair23.me>

Alistair

> ---
> drivers/input/touchscreen/wacom_i2c.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
> index c9188ee00c62..a145b9105255 100644
> --- a/drivers/input/touchscreen/wacom_i2c.c
> +++ b/drivers/input/touchscreen/wacom_i2c.c
> @@ -232,7 +232,7 @@ static int wacom_i2c_probe(struct i2c_client *client)
> return 0;
> }
>  
> -static int __maybe_unused wacom_i2c_suspend(struct device *dev)
> +static int wacom_i2c_suspend(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
>  
> @@ -241,7 +241,7 @@ static int __maybe_unused wacom_i2c_suspend(struct device *dev)
> return 0;
> }
>  
> -static int __maybe_unused wacom_i2c_resume(struct device *dev)
> +static int wacom_i2c_resume(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
>  
> @@ -250,7 +250,7 @@ static int __maybe_unused wacom_i2c_resume(struct device *dev)
> return 0;
> }
>  
> -static SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume);
>  
> static const struct i2c_device_id wacom_i2c_id[] = {
> { "WAC_I2C_EMR", 0 },
> @@ -261,7 +261,7 @@ MODULE_DEVICE_TABLE(i2c, wacom_i2c_id);
> static struct i2c_driver wacom_i2c_driver = {
> .driver = {
> .name = "wacom_i2c",
> - .pm = &wacom_i2c_pm,
> + .pm = pm_sleep_ptr(&wacom_i2c_pm),
> },
>  
> .probe_new = wacom_i2c_probe,
> -- 
> 2.39.0
> 
> 

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

* Re: [PATCH 08/69] Input: iqs269a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 ` [PATCH 08/69] Input: iqs269a " Jonathan Cameron
@ 2023-01-03 18:14   ` Jeff LaBundy
  0 siblings, 0 replies; 89+ messages in thread
From: Jeff LaBundy @ 2023-01-03 18:14 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron

Hi Jonathan,

On Mon, Jan 02, 2023 at 06:17:41PM +0000, 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>
> Cc: Jeff LaBundy <jeff@labundy.com>

Reviewed-by: Jeff LaBundy <jeff@labundy.com>

Thank you for doing this!

Just a note to Dmitry that this would need to be applied after [1] so
as to avoid a tiny merge conflict.

[1] https://patchwork.kernel.org/patch/13087784/

> ---
>  drivers/input/misc/iqs269a.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c
> index a348247d3d38..8348d8c85e1d 100644
> --- a/drivers/input/misc/iqs269a.c
> +++ b/drivers/input/misc/iqs269a.c
> @@ -1697,7 +1697,7 @@ static int iqs269_probe(struct i2c_client *client)
>  	return error;
>  }
>  
> -static int __maybe_unused iqs269_suspend(struct device *dev)
> +static int iqs269_suspend(struct device *dev)
>  {
>  	struct iqs269_private *iqs269 = dev_get_drvdata(dev);
>  	struct i2c_client *client = iqs269->client;
> @@ -1756,7 +1756,7 @@ static int __maybe_unused iqs269_suspend(struct device *dev)
>  	return error;
>  }
>  
> -static int __maybe_unused iqs269_resume(struct device *dev)
> +static int iqs269_resume(struct device *dev)
>  {
>  	struct iqs269_private *iqs269 = dev_get_drvdata(dev);
>  	struct i2c_client *client = iqs269->client;
> @@ -1803,7 +1803,7 @@ static int __maybe_unused iqs269_resume(struct device *dev)
>  	return error;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume);
>  
>  static const struct of_device_id iqs269_of_match[] = {
>  	{ .compatible = "azoteq,iqs269a" },
> @@ -1815,7 +1815,7 @@ static struct i2c_driver iqs269_i2c_driver = {
>  	.driver = {
>  		.name = "iqs269a",
>  		.of_match_table = iqs269_of_match,
> -		.pm = &iqs269_pm,
> +		.pm = pm_sleep_ptr(&iqs269_pm),
>  	},
>  	.probe_new = iqs269_probe,
>  };
> -- 
> 2.39.0
> 

Kind regards,
Jeff LaBundy

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

* Re: [PATCH 09/69] Input: iqs626a - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 ` [PATCH 09/69] Input: iqs626a " Jonathan Cameron
@ 2023-01-03 18:14   ` Jeff LaBundy
  0 siblings, 0 replies; 89+ messages in thread
From: Jeff LaBundy @ 2023-01-03 18:14 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron

On Mon, Jan 02, 2023 at 06:17:42PM +0000, 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: Jeff LaBundy <jeff@labundy.com>

> ---
>  drivers/input/misc/iqs626a.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/misc/iqs626a.c b/drivers/input/misc/iqs626a.c
> index 23b5dd9552dc..4727e6b95e41 100644
> --- a/drivers/input/misc/iqs626a.c
> +++ b/drivers/input/misc/iqs626a.c
> @@ -1712,7 +1712,7 @@ static int iqs626_probe(struct i2c_client *client)
>  	return error;
>  }
>  
> -static int __maybe_unused iqs626_suspend(struct device *dev)
> +static int iqs626_suspend(struct device *dev)
>  {
>  	struct iqs626_private *iqs626 = dev_get_drvdata(dev);
>  	struct i2c_client *client = iqs626->client;
> @@ -1771,7 +1771,7 @@ static int __maybe_unused iqs626_suspend(struct device *dev)
>  	return error;
>  }
>  
> -static int __maybe_unused iqs626_resume(struct device *dev)
> +static int iqs626_resume(struct device *dev)
>  {
>  	struct iqs626_private *iqs626 = dev_get_drvdata(dev);
>  	struct i2c_client *client = iqs626->client;
> @@ -1818,7 +1818,7 @@ static int __maybe_unused iqs626_resume(struct device *dev)
>  	return error;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume);
>  
>  static const struct of_device_id iqs626_of_match[] = {
>  	{ .compatible = "azoteq,iqs626a" },
> @@ -1830,7 +1830,7 @@ static struct i2c_driver iqs626_i2c_driver = {
>  	.driver = {
>  		.name = "iqs626a",
>  		.of_match_table = iqs626_of_match,
> -		.pm = &iqs626_pm,
> +		.pm = pm_sleep_ptr(&iqs626_pm),
>  	},
>  	.probe_new = iqs626_probe,
>  };
> -- 
> 2.39.0
> 

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

* Re: [PATCH 51/69] Input: iqs5xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 51/69] Input: iqs5xx " Jonathan Cameron
@ 2023-01-03 18:15   ` Jeff LaBundy
  0 siblings, 0 replies; 89+ messages in thread
From: Jeff LaBundy @ 2023-01-03 18:15 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-input, Dmitry Torokhov, Jonathan Cameron

On Mon, Jan 02, 2023 at 06:18:24PM +0000, 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>
> Cc: Jeff LaBundy <jeff@labundy.com>

Reviewed-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  drivers/input/touchscreen/iqs5xx.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
> index dc3137a34f35..c73e9c5c0077 100644
> --- a/drivers/input/touchscreen/iqs5xx.c
> +++ b/drivers/input/touchscreen/iqs5xx.c
> @@ -979,7 +979,7 @@ static const struct attribute_group iqs5xx_attr_group = {
>  	.attrs = iqs5xx_attrs,
>  };
>  
> -static int __maybe_unused iqs5xx_suspend(struct device *dev)
> +static int iqs5xx_suspend(struct device *dev)
>  {
>  	struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
>  	struct input_dev *input = iqs5xx->input;
> @@ -998,7 +998,7 @@ static int __maybe_unused iqs5xx_suspend(struct device *dev)
>  	return error;
>  }
>  
> -static int __maybe_unused iqs5xx_resume(struct device *dev)
> +static int iqs5xx_resume(struct device *dev)
>  {
>  	struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
>  	struct input_dev *input = iqs5xx->input;
> @@ -1017,7 +1017,7 @@ static int __maybe_unused iqs5xx_resume(struct device *dev)
>  	return error;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
>  
>  static int iqs5xx_probe(struct i2c_client *client)
>  {
> @@ -1090,7 +1090,7 @@ static struct i2c_driver iqs5xx_i2c_driver = {
>  	.driver = {
>  		.name		= "iqs5xx",
>  		.of_match_table	= iqs5xx_of_match,
> -		.pm		= &iqs5xx_pm,
> +		.pm		= pm_sleep_ptr(&iqs5xx_pm),
>  	},
>  	.id_table	= iqs5xx_id,
>  	.probe_new	= iqs5xx_probe,
> -- 
> 2.39.0
> 

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

* Re: [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (68 preceding siblings ...)
  2023-01-02 18:18 ` [PATCH 69/69] Input: ipaq-micro-ts - use " Jonathan Cameron
@ 2023-01-04  0:01 ` Linus Walleij
  2023-01-11  0:54 ` Dmitry Torokhov
  70 siblings, 0 replies; 89+ messages in thread
From: Linus Walleij @ 2023-01-04  0:01 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-input, Dmitry Torokhov, Jonathan Cameron, Paul Cercueil,
	Roy Im, Moritz Fischer, Luca Weiss, Jeff LaBundy,
	Krzysztof Kozlowski, Geert Uytterhoeven, Stephen Boyd,
	Damien Riegel, Lars-Peter Clausen, Pascal Paillet, Tony Lindgren,
	Raul E Rangel, Hans de Goede, Michael Hennerich, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Heiko Stuebner, Zhu Yi,
	Mark Jonas, Michael Trimarchi, Dario Binacchi, Daniel Mack,
	Jonathan Neuschäfer, Douglas Anderson, Bastien Nocera,
	Anthony Kim, Joe Hung, Markuss Broks, Haibo Chen, Sangwon Jee,
	Vincent Knecht, Fabio Estevam, John Keeping, Stephen Just,
	Benjamin Tissoires, Dario Binacchi, Alistair Francis

On Mon, Jan 2, 2023 at 7:05 PM Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This 2nd set is a continuation from:
> https://lore.kernel.org/all/20221204180841.2211588-1-jic23@kernel.org/

This is nice.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 16/69] Input: pm8941-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 ` [PATCH 16/69] Input: pm8941-pwrkey " Jonathan Cameron
@ 2023-01-04  1:01   ` Stephen Boyd
  0 siblings, 0 replies; 89+ messages in thread
From: Stephen Boyd @ 2023-01-04  1:01 UTC (permalink / raw)
  To: Dmitry Torokhov, Jonathan Cameron, linux-input; +Cc: Jonathan Cameron

Quoting Jonathan Cameron (2023-01-02 10:17:49)
> 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] 89+ messages in thread

* Re: [PATCH 18/69] Input: pmic8xxx-pwrkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 ` [PATCH 18/69] Input: pmic8xxx-pwrkey " Jonathan Cameron
@ 2023-01-04  1:02   ` Stephen Boyd
  0 siblings, 0 replies; 89+ messages in thread
From: Stephen Boyd @ 2023-01-04  1:02 UTC (permalink / raw)
  To: Dmitry Torokhov, Jonathan Cameron, linux-input; +Cc: Jonathan Cameron

Quoting Jonathan Cameron (2023-01-02 10:17:51)
> 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] 89+ messages in thread

* Re: [PATCH 34/69] Input: auo-pixcir-ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 34/69] Input: auo-pixcir-ts " Jonathan Cameron
@ 2023-01-04 10:33   ` Heiko Stübner
  0 siblings, 0 replies; 89+ messages in thread
From: Heiko Stübner @ 2023-01-04 10:33 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Jonathan Cameron; +Cc: Jonathan Cameron

Am Montag, 2. Januar 2023, 19:18:07 CET schrieb 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>
> Cc: Heiko Stuebner <heiko@sntech.de>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>



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

* Re: [PATCH 26/69] Input: elan_i2c_core - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:17 ` [PATCH 26/69] Input: elan_i2c_core " Jonathan Cameron
@ 2023-01-09  8:44   ` Hans de Goede
  0 siblings, 0 replies; 89+ messages in thread
From: Hans de Goede @ 2023-01-09  8:44 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Raul E Rangel

Hi,

On 1/2/23 19:17, 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>
> Cc: Raul E Rangel <rrangel@chromium.org>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/input/mouse/elan_i2c_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> index 76729ada1582..5f0d75a45c80 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -1328,7 +1328,7 @@ static int elan_probe(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static int __maybe_unused elan_suspend(struct device *dev)
> +static int elan_suspend(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	struct elan_tp_data *data = i2c_get_clientdata(client);
> @@ -1365,7 +1365,7 @@ static int __maybe_unused elan_suspend(struct device *dev)
>  	return ret;
>  }
>  
> -static int __maybe_unused elan_resume(struct device *dev)
> +static int elan_resume(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	struct elan_tp_data *data = i2c_get_clientdata(client);
> @@ -1394,7 +1394,7 @@ static int __maybe_unused elan_resume(struct device *dev)
>  	return error;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(elan_pm_ops, elan_suspend, elan_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(elan_pm_ops, elan_suspend, elan_resume);
>  
>  static const struct i2c_device_id elan_id[] = {
>  	{ DRIVER_NAME, 0 },
> @@ -1418,7 +1418,7 @@ MODULE_DEVICE_TABLE(of, elan_of_match);
>  static struct i2c_driver elan_driver = {
>  	.driver = {
>  		.name	= DRIVER_NAME,
> -		.pm	= &elan_pm_ops,
> +		.pm	= pm_sleep_ptr(&elan_pm_ops),
>  		.acpi_match_table = ACPI_PTR(elan_acpi_id),
>  		.of_match_table = of_match_ptr(elan_of_match),
>  		.probe_type = PROBE_PREFER_ASYNCHRONOUS,


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

* Re: [PATCH 37/69] Input: chipone_in8318 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 37/69] Input: chipone_in8318 " Jonathan Cameron
@ 2023-01-09  8:44   ` Hans de Goede
  0 siblings, 0 replies; 89+ messages in thread
From: Hans de Goede @ 2023-01-09  8:44 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

Hi,

On 1/2/23 19:18, 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 #ifdef guards.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/input/touchscreen/chipone_icn8318.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c
> index f6769e4bd4f2..32b714a6ed2d 100644
> --- a/drivers/input/touchscreen/chipone_icn8318.c
> +++ b/drivers/input/touchscreen/chipone_icn8318.c
> @@ -148,7 +148,6 @@ static void icn8318_stop(struct input_dev *dev)
>  	gpiod_set_value_cansleep(data->wake_gpio, 0);
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int icn8318_suspend(struct device *dev)
>  {
>  	struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev));
> @@ -172,9 +171,8 @@ static int icn8318_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif
>  
> -static SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume);
>  
>  static int icn8318_probe(struct i2c_client *client)
>  {
> @@ -263,7 +261,7 @@ MODULE_DEVICE_TABLE(i2c, icn8318_i2c_id);
>  static struct i2c_driver icn8318_driver = {
>  	.driver = {
>  		.name	= "chipone_icn8318",
> -		.pm	= &icn8318_pm_ops,
> +		.pm	= pm_sleep_ptr(&icn8318_pm_ops),
>  		.of_match_table = icn8318_of_match,
>  	},
>  	.probe_new = icn8318_probe,


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

* Re: [PATCH 38/69] Input: chipone_icn8505 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 38/69] Input: chipone_icn8505 " Jonathan Cameron
@ 2023-01-09  8:44   ` Hans de Goede
  0 siblings, 0 replies; 89+ messages in thread
From: Hans de Goede @ 2023-01-09  8:44 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

Hi,

On 1/2/23 19:18, 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>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/input/touchscreen/chipone_icn8505.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/chipone_icn8505.c b/drivers/input/touchscreen/chipone_icn8505.c
> index c421f4be2700..246bee0bee53 100644
> --- a/drivers/input/touchscreen/chipone_icn8505.c
> +++ b/drivers/input/touchscreen/chipone_icn8505.c
> @@ -460,7 +460,7 @@ static int icn8505_probe(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static int __maybe_unused icn8505_suspend(struct device *dev)
> +static int icn8505_suspend(struct device *dev)
>  {
>  	struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev));
>  
> @@ -471,7 +471,7 @@ static int __maybe_unused icn8505_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused icn8505_resume(struct device *dev)
> +static int icn8505_resume(struct device *dev)
>  {
>  	struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev));
>  	int error;
> @@ -484,7 +484,7 @@ static int __maybe_unused icn8505_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume);
>  
>  static const struct acpi_device_id icn8505_acpi_match[] = {
>  	{ "CHPN0001" },
> @@ -495,7 +495,7 @@ MODULE_DEVICE_TABLE(acpi, icn8505_acpi_match);
>  static struct i2c_driver icn8505_driver = {
>  	.driver = {
>  		.name	= "chipone_icn8505",
> -		.pm	= &icn8505_pm_ops,
> +		.pm	= pm_sleep_ptr(&icn8505_pm_ops),
>  		.acpi_match_table = icn8505_acpi_match,
>  	},
>  	.probe_new = icn8505_probe,


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

* Re: [PATCH 44/69] input: ektf2127 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 44/69] input: ektf2127 " Jonathan Cameron
@ 2023-01-09  8:44   ` Hans de Goede
  0 siblings, 0 replies; 89+ messages in thread
From: Hans de Goede @ 2023-01-09  8:44 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Jonathan Neuschäfer

Hi,

On 1/2/23 19:18, 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>
> Cc: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/input/touchscreen/ektf2127.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
> index 328841eaa1b7..e6f1e46d003d 100644
> --- a/drivers/input/touchscreen/ektf2127.c
> +++ b/drivers/input/touchscreen/ektf2127.c
> @@ -177,7 +177,7 @@ static void ektf2127_stop(struct input_dev *dev)
>  	gpiod_set_value_cansleep(ts->power_gpios, 0);
>  }
>  
> -static int __maybe_unused ektf2127_suspend(struct device *dev)
> +static int ektf2127_suspend(struct device *dev)
>  {
>  	struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
>  
> @@ -189,7 +189,7 @@ static int __maybe_unused ektf2127_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused ektf2127_resume(struct device *dev)
> +static int ektf2127_resume(struct device *dev)
>  {
>  	struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
>  
> @@ -201,8 +201,8 @@ static int __maybe_unused ektf2127_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend,
> -			 ektf2127_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend,
> +				ektf2127_resume);
>  
>  static int ektf2127_query_dimension(struct i2c_client *client, bool width)
>  {
> @@ -348,7 +348,7 @@ MODULE_DEVICE_TABLE(i2c, ektf2127_i2c_id);
>  static struct i2c_driver ektf2127_driver = {
>  	.driver = {
>  		.name	= "elan_ektf2127",
> -		.pm	= &ektf2127_pm_ops,
> +		.pm	= pm_sleep_ptr(&ektf2127_pm_ops),
>  		.of_match_table = of_match_ptr(ektf2127_of_match),
>  	},
>  	.probe_new = ektf2127_probe,


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

* Re: [PATCH 46/69] Input: goodix - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 46/69] Input: goodix " Jonathan Cameron
@ 2023-01-09  8:45   ` Hans de Goede
  0 siblings, 0 replies; 89+ messages in thread
From: Hans de Goede @ 2023-01-09  8:45 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov
  Cc: Jonathan Cameron, Bastien Nocera

Hi,

On 1/2/23 19:18, 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>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Bastien Nocera <hadess@hadess.net>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/input/touchscreen/goodix.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> index 8a0a8078de8f..b348172f19c3 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -1401,7 +1401,7 @@ static void goodix_ts_remove(struct i2c_client *client)
>  		wait_for_completion(&ts->firmware_loading_complete);
>  }
>  
> -static int __maybe_unused goodix_suspend(struct device *dev)
> +static int goodix_suspend(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	struct goodix_ts_data *ts = i2c_get_clientdata(client);
> @@ -1448,7 +1448,7 @@ static int __maybe_unused goodix_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused goodix_resume(struct device *dev)
> +static int goodix_resume(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	struct goodix_ts_data *ts = i2c_get_clientdata(client);
> @@ -1497,7 +1497,7 @@ static int __maybe_unused goodix_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume);
>  
>  static const struct i2c_device_id goodix_ts_id[] = {
>  	{ "GDIX1001:00", 0 },
> @@ -1543,7 +1543,7 @@ static struct i2c_driver goodix_ts_driver = {
>  		.name = "Goodix-TS",
>  		.acpi_match_table = ACPI_PTR(goodix_acpi_match),
>  		.of_match_table = of_match_ptr(goodix_of_match),
> -		.pm = &goodix_pm_ops,
> +		.pm = pm_sleep_ptr(&goodix_pm_ops),
>  	},
>  };
>  module_i2c_driver(goodix_ts_driver);


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

* Re: [PATCH 59/69] Input: silead - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 59/69] Input: silead " Jonathan Cameron
@ 2023-01-09  8:45   ` Hans de Goede
  0 siblings, 0 replies; 89+ messages in thread
From: Hans de Goede @ 2023-01-09  8:45 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron

Hi,

On 1/2/23 19:18, 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>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/input/touchscreen/silead.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
> index 8a7351c4414c..a37fac089010 100644
> --- a/drivers/input/touchscreen/silead.c
> +++ b/drivers/input/touchscreen/silead.c
> @@ -736,7 +736,7 @@ static int silead_ts_probe(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static int __maybe_unused silead_ts_suspend(struct device *dev)
> +static int silead_ts_suspend(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  
> @@ -745,7 +745,7 @@ static int __maybe_unused silead_ts_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused silead_ts_resume(struct device *dev)
> +static int silead_ts_resume(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	bool second_try = false;
> @@ -784,7 +784,7 @@ static int __maybe_unused silead_ts_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume);
>  
>  static const struct i2c_device_id silead_ts_id[] = {
>  	{ "gsl1680", 0 },
> @@ -832,7 +832,7 @@ static struct i2c_driver silead_ts_driver = {
>  		.name = SILEAD_TS_NAME,
>  		.acpi_match_table = ACPI_PTR(silead_ts_acpi_match),
>  		.of_match_table = of_match_ptr(silead_ts_of_match),
> -		.pm = &silead_ts_pm,
> +		.pm = pm_sleep_ptr(&silead_ts_pm),
>  	},
>  };
>  module_i2c_driver(silead_ts_driver);


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

* RE: [PATCH 30/69] Input: ad7877 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  2023-01-02 18:18 ` [PATCH 30/69] Input: ad7877 " Jonathan Cameron
@ 2023-01-09 10:18   ` Hennerich, Michael
  0 siblings, 0 replies; 89+ messages in thread
From: Hennerich, Michael @ 2023-01-09 10:18 UTC (permalink / raw)
  To: Jonathan Cameron, linux-input, Dmitry Torokhov; +Cc: Jonathan Cameron



> -----Original Message-----
> From: Jonathan Cameron <jic23@kernel.org>
> Sent: Montag, 2. Januar 2023 19:18
> To: linux-input@vger.kernel.org; Dmitry Torokhov
> <dmitry.torokhov@gmail.com>
> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>; Hennerich, Michael
> <Michael.Hennerich@analog.com>
> Subject: [PATCH 30/69] Input: ad7877 - switch to
> DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
> 
> 
> 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>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

> ---
>  drivers/input/touchscreen/ad7877.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ad7877.c
> b/drivers/input/touchscreen/ad7877.c
> index 08f5372f0bfd..edb36d663f22 100644
> --- a/drivers/input/touchscreen/ad7877.c
> +++ b/drivers/input/touchscreen/ad7877.c
> @@ -788,7 +788,7 @@ static int ad7877_probe(struct spi_device *spi)
>  	return 0;
>  }
> 
> -static int __maybe_unused ad7877_suspend(struct device *dev)
> +static int ad7877_suspend(struct device *dev)
>  {
>  	struct ad7877 *ts = dev_get_drvdata(dev);
> 
> @@ -797,7 +797,7 @@ static int __maybe_unused ad7877_suspend(struct
> device *dev)
>  	return 0;
>  }
> 
> -static int __maybe_unused ad7877_resume(struct device *dev)
> +static int ad7877_resume(struct device *dev)
>  {
>  	struct ad7877 *ts = dev_get_drvdata(dev);
> 
> @@ -806,12 +806,12 @@ static int __maybe_unused ad7877_resume(struct
> device *dev)
>  	return 0;
>  }
> 
> -static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend,
> +ad7877_resume);
> 
>  static struct spi_driver ad7877_driver = {
>  	.driver = {
>  		.name	= "ad7877",
> -		.pm	= &ad7877_pm,
> +		.pm	= pm_sleep_ptr(&ad7877_pm),
>  	},
>  	.probe		= ad7877_probe,
>  };
> --
> 2.39.0


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

* Re: [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2
  2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
                   ` (69 preceding siblings ...)
  2023-01-04  0:01 ` [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Linus Walleij
@ 2023-01-11  0:54 ` Dmitry Torokhov
  70 siblings, 0 replies; 89+ messages in thread
From: Dmitry Torokhov @ 2023-01-11  0:54 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-input, Jonathan Cameron, Paul Cercueil, Roy Im,
	Moritz Fischer, Luca Weiss, Jeff LaBundy, Krzysztof Kozlowski,
	Geert Uytterhoeven, Stephen Boyd, Damien Riegel,
	Lars-Peter Clausen, Pascal Paillet, Tony Lindgren, Raul E Rangel,
	Hans de Goede, Michael Hennerich, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Heiko Stuebner, Linus Walleij,
	Zhu Yi, Mark Jonas, Michael Trimarchi, Dario Binacchi,
	Daniel Mack, Jonathan Neuschäfer, Douglas Anderson,
	Bastien Nocera, Anthony Kim, Joe Hung, Markuss Broks, Haibo Chen,
	Sangwon Jee, Vincent Knecht, Fabio Estevam, John Keeping,
	Stephen Just, Benjamin Tissoires, Dario Binacchi,
	Alistair Francis

On Mon, Jan 02, 2023 at 06:17:33PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This 2nd set is a continuation from:
> https://lore.kernel.org/all/20221204180841.2211588-1-jic23@kernel.org/
> 
> A 3rd set (maybe more than one) will cover the remaining more
> complex cases in Input that go beyond a straight forward switch.
> Those will need more careful review than this (hopefully) simple
> set.
> 
> As part of recent changes to the macros in linux/pm.h, the
> SIMPLE_DEV_PM_OPS() macro is deprecated in favor of the combination
> 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.

Applied the lot, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2023-01-11  0:54 UTC | newest]

Thread overview: 89+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 18:17 [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Jonathan Cameron
2023-01-02 18:17 ` [PATCH 01/69] Input: 88pm860x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Jonathan Cameron
2023-01-02 18:17 ` [PATCH 02/69] Input: da7280 " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 03/69] Input: drv260x " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 04/69] Input: drv2665 " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 05/69] Input: drv2667 " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 06/69] Input: e3x0-button " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 07/69] Input: gpio-vibra " Jonathan Cameron
2023-01-02 19:30   ` Luca Weiss
2023-01-02 18:17 ` [PATCH 08/69] Input: iqs269a " Jonathan Cameron
2023-01-03 18:14   ` Jeff LaBundy
2023-01-02 18:17 ` [PATCH 09/69] Input: iqs626a " Jonathan Cameron
2023-01-03 18:14   ` Jeff LaBundy
2023-01-02 18:17 ` [PATCH 10/69] Input: kxtj9 " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 11/69] Input: max77693-haptic " Jonathan Cameron
2023-01-03  7:54   ` Krzysztof Kozlowski
2023-01-02 18:17 ` [PATCH 12/69] Input: max8925_onkey " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 13/69] Input: max8997_haptic " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 14/69] Input: palmas-pwrbutton " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 15/69] Input: pcfg8574_keypad " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 16/69] Input: pm8941-pwrkey " Jonathan Cameron
2023-01-04  1:01   ` Stephen Boyd
2023-01-02 18:17 ` [PATCH 17/69] Input: pm8xxx-vibrator " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 18/69] Input: pmic8xxx-pwrkey " Jonathan Cameron
2023-01-04  1:02   ` Stephen Boyd
2023-01-02 18:17 ` [PATCH 19/69] Input: pwm-beeper " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 20/69] Input: pwm-vibra " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 21/69] Input: regulator-haptic " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 22/69] Input: rotary-encoder " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 23/69] Input: stpmic1_onekey " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 24/69] Input: twl4030-vibra " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 25/69] Input: twl6030-vibra " Jonathan Cameron
2023-01-02 18:17 ` [PATCH 26/69] Input: elan_i2c_core " Jonathan Cameron
2023-01-09  8:44   ` Hans de Goede
2023-01-02 18:18 ` [PATCH 27/69] Input: navpoint " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 28/69] Input: synaptics_i2c " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 29/69] Input: ambakmi " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 30/69] Input: ad7877 " Jonathan Cameron
2023-01-09 10:18   ` Hennerich, Michael
2023-01-02 18:18 ` [PATCH 31/69] Input: ads7846 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 32/69] Input: ar1021 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 33/69] Input: atmel_mxt_ts " Jonathan Cameron
2023-01-03  8:45   ` Claudiu.Beznea
2023-01-02 18:18 ` [PATCH 34/69] Input: auo-pixcir-ts " Jonathan Cameron
2023-01-04 10:33   ` Heiko Stübner
2023-01-02 18:18 ` [PATCH 35/69] Input: bu21013_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 36/69] Input: bu21029 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 37/69] Input: chipone_in8318 " Jonathan Cameron
2023-01-09  8:44   ` Hans de Goede
2023-01-02 18:18 ` [PATCH 38/69] Input: chipone_icn8505 " Jonathan Cameron
2023-01-09  8:44   ` Hans de Goede
2023-01-02 18:18 ` [PATCH 39/69] Input: cy8ctma140 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 40/69] Input: cy8ctmg110_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 41/69] Input: edt-ft5x06 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 42/69] Input: eeti_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 43/69] Input: egalax_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 44/69] input: ektf2127 " Jonathan Cameron
2023-01-09  8:44   ` Hans de Goede
2023-01-02 18:18 ` [PATCH 45/69] Input: elants_i2c " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 46/69] Input: goodix " Jonathan Cameron
2023-01-09  8:45   ` Hans de Goede
2023-01-02 18:18 ` [PATCH 47/69] Input: hideep " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 48/69] Input: ilitek_ts_i2c " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 49/69] Input: imagis " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 50/69] Input: imx6ul_tsc " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 51/69] Input: iqs5xx " Jonathan Cameron
2023-01-03 18:15   ` Jeff LaBundy
2023-01-02 18:18 ` [PATCH 52/69] Input: mcs5000_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 53/69] Input: melfas_mip4 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 54/69] input: migor_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 55/69] Input: mms114 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 56/69] Input: msg2638 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 57/69] Input: pixcir_i2c_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 58/69] Input: raydium_i2c_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 59/69] Input: silead " Jonathan Cameron
2023-01-09  8:45   ` Hans de Goede
2023-01-02 18:18 ` [PATCH 60/69] Input: st1232 " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 61/69] Input: surface3_spi " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 62/69] Input: ti_am335x_tsc " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 63/69] Input: ucb1400_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 64/69] Input: wacom_i2c " Jonathan Cameron
2023-01-03 10:39   ` Alistair
2023-01-02 18:18 ` [PATCH 65/69] Input: wdt87xx_i2c " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 66/69] Input: wm97xx " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 67/69] Input: zforce_ts " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 68/69] Input: zinitix " Jonathan Cameron
2023-01-02 18:18 ` [PATCH 69/69] Input: ipaq-micro-ts - use " Jonathan Cameron
2023-01-04  0:01 ` [PATCH 00/69] Input: Switch to DEFINE_SIMPLE_DEV_PM_OP() set 2 Linus Walleij
2023-01-11  0:54 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.