Skip to contentSkip to conversation

Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS()

PATCH In review Jonathan Cameron 6 participants 39 messages Dec 4, 2022 – Dec 7, 2022

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

cover Input: Joystick keyboard switch to DEFINE_SIMPLE_DEV_PM_OPS()

From: Jonathan Cameron <[email protected]>

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

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

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

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

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

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

Cc Paul Cercueil <[email protected]>
Cc Tomohiro Yoshidomi <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Yassine Oudjana <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Michal Vokáč <[email protected]>
Cc Mattijs Korpershoek <[email protected]>
Cc Marco Felsch <[email protected]>
Cc Stephan Gerhold <[email protected]>
Cc Marek Vasut <[email protected]>

Jonathan Cameron (32):
Input: pxspad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and

    pm_sleep_ptr()
  Input: adp5589-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: cros-ec-keyb - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: cypress-sf - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ep39xx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: gpio-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: ipaq-micro-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mpr121-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mtk-pmic-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: qt1050 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: spear-keyboard - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tm2-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: lm8323 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: lpc32xx-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: matrix-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: max7359-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: mcs-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pmic8xxx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: pxa27x_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: qt1070 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: st-keyscan - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tca6416-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()
  Input: tegra-kbc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and
    pm_sleep_ptr()

Input: tegra-kbc - allow build with COMPILE_TEST
Input: spear-keyboard - improve build coverage using COMPILE_TEST
Input: pxa27xx-keypad - allow build with COMPILE_TEST
Input: nomadik-ske-keypad - allow building with COMPILE_TEST
Input: lpc32xx - allow building with COMPILE_TEST
Input: pxspad: Fix unused data warning when force feedback not
enabled.

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

PATCH 1/32 Input: pxspad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

From: Jonathan Cameron <[email protected]>

SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against used function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings.

Cc Tomohiro Yoshidomi <[email protected]>
---
 drivers/input/joystick/psxpad-spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/input/joystick/psxpad-spi.c +3 -3
index a32656064f39..2c395af13d42 100644
@@ -371,7 +371,7 @@ static int psxpad_spi_probe(struct spi_device *spi)
 	return 0;
 }
 
-static int __maybe_unused psxpad_spi_suspend(struct device *dev)
+static int psxpad_spi_suspend(struct device *dev)
 {
 	struct spi_device *spi = to_spi_device(dev);
 	struct psxpad *pad = spi_get_drvdata(spi);
@@ -381,7 +381,7 @@ static int __maybe_unused psxpad_spi_suspend(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL);
+static DEFINE_SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL);
 
 static const struct spi_device_id psxpad_spi_id[] = {
 	{ "psxpad-spi", 0 },
@@ -392,7 +392,7 @@ MODULE_DEVICE_TABLE(spi, psxpad_spi_id);
 static struct spi_driver psxpad_spi_driver = {
 	.driver = {
 		.name = "psxpad-spi",
-		.pm = &psxpad_spi_pm,
+		.pm = pm_sleep_ptr(&psxpad_spi_pm),
 	},
 	.id_table = psxpad_spi_id,
 	.probe   = psxpad_spi_probe,
Signature · 1 line
2.38.1
#2 lore raw

PATCH 2/32 Input: adp5589-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Michael Hennerich <[email protected]>
---
 drivers/input/keyboard/adp5589-keys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/input/keyboard/adp5589-keys.c +4 -4
index 25c9f6344bf2..38d7073863a8 100644
@@ -1016,7 +1016,7 @@ static int adp5589_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused adp5589_suspend(struct device *dev)
+static int adp5589_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct adp5589_kpad *kpad = i2c_get_clientdata(client);
@@ -1027,7 +1027,7 @@ static int __maybe_unused adp5589_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused adp5589_resume(struct device *dev)
+static int adp5589_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct adp5589_kpad *kpad = i2c_get_clientdata(client);
@@ -1038,7 +1038,7 @@ static int __maybe_unused adp5589_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);
 
 static const struct i2c_device_id adp5589_id[] = {
 	{"adp5589-keys", ADP5589},
@@ -1052,7 +1052,7 @@ MODULE_DEVICE_TABLE(i2c, adp5589_id);
 static struct i2c_driver adp5589_driver = {
 	.driver = {
 		.name = KBUILD_MODNAME,
-		.pm = &adp5589_dev_pm_ops,
+		.pm = pm_sleep_ptr(&adp5589_dev_pm_ops),
 	},
 	.probe_new = adp5589_probe,
 	.id_table = adp5589_id,
Signature · 1 line
2.38.1
#3 lore raw

PATCH 3/32 Input: cros-ec-keyb - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/cros_ec_keyb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/input/keyboard/cros_ec_keyb.c +3 -3
index c14136b733a9..6f435125ec03 100644
@@ -415,7 +415,7 @@ static int cros_ec_keyb_query_switches(struct cros_ec_keyb *ckdev)
  *
  * Returns 0 if no error or -error upon error.
  */
-static __maybe_unused int cros_ec_keyb_resume(struct device *dev)
+static int cros_ec_keyb_resume(struct device *dev)
 {
 	struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
 
@@ -760,7 +760,7 @@ static const struct of_device_id cros_ec_keyb_of_match[] = {
 MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match);
 #endif
 
-static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
 
 static struct platform_driver cros_ec_keyb_driver = {
 	.probe = cros_ec_keyb_probe,
@@ -769,7 +769,7 @@ static struct platform_driver cros_ec_keyb_driver = {
 		.name = "cros-ec-keyb",
 		.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
 		.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
-		.pm = &cros_ec_keyb_pm_ops,
+		.pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
 	},
 };
 
Signature · 1 line
2.38.1
Reviewed-by on v1 3/32
#4 lore raw

Re: [PATCH 03/32] Input: cros-ec-keyb - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

Quoting Jonathan Cameron (2022-12-04 10:08:12)

Quoted 11 lines

From: Jonathan Cameron <[email protected]>

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.

---

#5 lore raw

PATCH 4/32 Input: cypress-sf - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/cypress-sf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/keyboard/cypress-sf.c +5 -5
index 9a23eed6a4f4..686388f40317 100644
@@ -168,7 +168,7 @@ static int cypress_sf_probe(struct i2c_client *client)
 	return 0;
 };
 
-static int __maybe_unused cypress_sf_suspend(struct device *dev)
+static int cypress_sf_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
@@ -187,7 +187,7 @@ static int __maybe_unused cypress_sf_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused cypress_sf_resume(struct device *dev)
+static int cypress_sf_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
@@ -205,8 +205,8 @@ static int __maybe_unused cypress_sf_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
-			 cypress_sf_suspend, cypress_sf_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
+				cypress_sf_suspend, cypress_sf_resume);
 
 static struct i2c_device_id cypress_sf_id_table[] = {
 	{ CYPRESS_SF_DEV_NAME, 0 },
@@ -225,7 +225,7 @@ MODULE_DEVICE_TABLE(of, cypress_sf_of_match);
 static struct i2c_driver cypress_sf_driver = {
 	.driver = {
 		.name = CYPRESS_SF_DEV_NAME,
-		.pm = &cypress_sf_pm_ops,
+		.pm = pm_sleep_ptr(&cypress_sf_pm_ops),
 		.of_match_table = of_match_ptr(cypress_sf_of_match),
 	},
 	.id_table = cypress_sf_id_table,
Signature · 1 line
2.38.1
#6 lore raw

PATCH 5/32 Input: ep39xx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/ep93xx_keypad.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/keyboard/ep93xx_keypad.c +5 -5
index f5bf7524722a..55075addcac2 100644
@@ -178,7 +178,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
 }
 
 
-static int __maybe_unused ep93xx_keypad_suspend(struct device *dev)
+static int ep93xx_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
@@ -196,7 +196,7 @@ static int __maybe_unused ep93xx_keypad_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused ep93xx_keypad_resume(struct device *dev)
+static int ep93xx_keypad_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
@@ -217,8 +217,8 @@ static int __maybe_unused ep93xx_keypad_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
-			 ep93xx_keypad_suspend, ep93xx_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
+				ep93xx_keypad_suspend, ep93xx_keypad_resume);
 
 static void ep93xx_keypad_release_gpio_action(void *_pdev)
 {
@@ -318,7 +318,7 @@ static int ep93xx_keypad_remove(struct platform_device *pdev)
 static struct platform_driver ep93xx_keypad_driver = {
 	.driver		= {
 		.name	= "ep93xx-keypad",
-		.pm	= &ep93xx_keypad_pm_ops,
+		.pm	= pm_sleep_ptr(&ep93xx_keypad_pm_ops),
 	},
 	.probe		= ep93xx_keypad_probe,
 	.remove		= ep93xx_keypad_remove,
Signature · 1 line
2.38.1
#7 lore raw

PATCH 6/32 Input: gpio-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/gpio_keys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/input/keyboard/gpio_keys.c +4 -4
index a5dc4ab87fa1..5496482a38c1 100644
@@ -992,7 +992,7 @@ gpio_keys_disable_wakeup(struct gpio_keys_drvdata *ddata)
 	}
 }
 
-static int __maybe_unused gpio_keys_suspend(struct device *dev)
+static int gpio_keys_suspend(struct device *dev)
 {
 	struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
 	struct input_dev *input = ddata->input;
@@ -1012,7 +1012,7 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused gpio_keys_resume(struct device *dev)
+static int gpio_keys_resume(struct device *dev)
 {
 	struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
 	struct input_dev *input = ddata->input;
@@ -1034,7 +1034,7 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
 
 static void gpio_keys_shutdown(struct platform_device *pdev)
 {
@@ -1050,7 +1050,7 @@ static struct platform_driver gpio_keys_device_driver = {
 	.shutdown	= gpio_keys_shutdown,
 	.driver		= {
 		.name	= "gpio-keys",
-		.pm	= &gpio_keys_pm_ops,
+		.pm	= pm_sleep_ptr(&gpio_keys_pm_ops),
 		.of_match_table = gpio_keys_of_match,
 		.dev_groups	= gpio_keys_groups,
 	}
Signature · 1 line
2.38.1
#8 lore raw

PATCH 7/32 Input: ipaq-micro-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/ipaq-micro-keys.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/keyboard/ipaq-micro-keys.c +5 -5
index 13a66a8e3411..7b509bce2b33 100644
@@ -124,7 +124,7 @@ static int micro_key_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused micro_key_suspend(struct device *dev)
+static int micro_key_suspend(struct device *dev)
 {
 	struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
 
@@ -133,7 +133,7 @@ static int __maybe_unused micro_key_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused micro_key_resume(struct device *dev)
+static int micro_key_resume(struct device *dev)
 {
 	struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
 	struct input_dev *input = keys->input;
@@ -148,13 +148,13 @@ static int __maybe_unused micro_key_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops,
-			 micro_key_suspend, micro_key_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops,
+				micro_key_suspend, micro_key_resume);
 
 static struct platform_driver micro_key_device_driver = {
 	.driver = {
 		.name    = "ipaq-micro-keys",
-		.pm	= &micro_key_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&micro_key_dev_pm_ops),
 	},
 	.probe   = micro_key_probe,
 };
Signature · 1 line
2.38.1
Acked-by on v1 7/32
#9 lore raw

Re: [PATCH 07/32] Input: ipaq-micro-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Yours,
Linus Walleij

#10 lore raw

PATCH 8/32 Input: mpr121-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/mpr121_touchkey.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/input/keyboard/mpr121_touchkey.c +4 -4
index 4610ef55903c..74ad353462a3 100644
@@ -340,7 +340,7 @@ static int mpr_touchkey_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused mpr_suspend(struct device *dev)
+static int mpr_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
@@ -352,7 +352,7 @@ static int __maybe_unused mpr_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mpr_resume(struct device *dev)
+static int mpr_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client);
@@ -366,7 +366,7 @@ static int __maybe_unused mpr_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
 
 static const struct i2c_device_id mpr121_id[] = {
 	{ "mpr121_touchkey", 0 },
@@ -385,7 +385,7 @@ MODULE_DEVICE_TABLE(of, mpr121_touchkey_dt_match_table);
 static struct i2c_driver mpr_touchkey_driver = {
 	.driver = {
 		.name	= "mpr121",
-		.pm	= &mpr121_touchkey_pm_ops,
+		.pm	= pm_sleep_ptr(&mpr121_touchkey_pm_ops),
 		.of_match_table = of_match_ptr(mpr121_touchkey_dt_match_table),
 	},
 	.id_table	= mpr121_id,
Signature · 1 line
2.38.1
#11 lore raw

PATCH 9/32 Input: mtk-pmic-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Mattijs Korpershoek <[email protected]>
---
 drivers/input/keyboard/mtk-pmic-keys.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/keyboard/mtk-pmic-keys.c +5 -5
index 9b34da0ec260..3d4ffa25e3df 100644
@@ -231,7 +231,7 @@ static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys,
 	return 0;
 }
 
-static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
+static int mtk_pmic_keys_suspend(struct device *dev)
 {
 	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
 	int index;
@@ -247,7 +247,7 @@ static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
+static int mtk_pmic_keys_resume(struct device *dev)
 {
 	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
 	int index;
@@ -263,8 +263,8 @@ static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
-			mtk_pmic_keys_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
+				mtk_pmic_keys_resume);
 
 static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
 	{
@@ -387,7 +387,7 @@ static struct platform_driver pmic_keys_pdrv = {
 	.driver = {
 		   .name = "mtk-pmic-keys",
 		   .of_match_table = of_mtk_pmic_keys_match_tbl,
-		   .pm = &mtk_pmic_keys_pm_ops,
+		   .pm = pm_sleep_ptr(&mtk_pmic_keys_pm_ops),
 	},
 };
 
Signature · 1 line
2.38.1
Reviewed-by on v1 9/32
#12 lore raw

Re: [PATCH 09/32] Input: mtk-pmic-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Cc Mattijs Korpershoek <[email protected]>
Quoted 48 lines
---
 drivers/input/keyboard/mtk-pmic-keys.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/keyboard/mtk-pmic-keys.c +5 -5
index 9b34da0ec260..3d4ffa25e3df 100644
@@ -231,7 +231,7 @@ static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys,
 	return 0;
 }
 
-static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
+static int mtk_pmic_keys_suspend(struct device *dev)
 {
 	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
 	int index;
@@ -247,7 +247,7 @@ static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
+static int mtk_pmic_keys_resume(struct device *dev)
 {
 	struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
 	int index;
@@ -263,8 +263,8 @@ static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
-			mtk_pmic_keys_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
+				mtk_pmic_keys_resume);
 
 static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
 	{
@@ -387,7 +387,7 @@ static struct platform_driver pmic_keys_pdrv = {
 	.driver = {
 		   .name = "mtk-pmic-keys",
 		   .of_match_table = of_mtk_pmic_keys_match_tbl,
-		   .pm = &mtk_pmic_keys_pm_ops,
+		   .pm = pm_sleep_ptr(&mtk_pmic_keys_pm_ops),
 	},
 };
 
Signature · 1 line
2.38.1
#13 lore raw

PATCH 10/32 Input: qt1050 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/qt1050.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/input/keyboard/qt1050.c +4 -4
index 403060d05c3b..317fe2b1f827 100644
@@ -547,7 +547,7 @@ static int qt1050_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused qt1050_suspend(struct device *dev)
+static int qt1050_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct qt1050_priv *ts = i2c_get_clientdata(client);
@@ -563,7 +563,7 @@ static int __maybe_unused qt1050_suspend(struct device *dev)
 			    device_may_wakeup(dev) ? 125 : 0);
 }
 
-static int __maybe_unused qt1050_resume(struct device *dev)
+static int qt1050_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct qt1050_priv *ts = i2c_get_clientdata(client);
@@ -574,7 +574,7 @@ static int __maybe_unused qt1050_resume(struct device *dev)
 	return regmap_write(ts->regmap, QT1050_LPMODE, 2);
 }
 
-static SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
 
 static const struct of_device_id __maybe_unused qt1050_of_match[] = {
 	{ .compatible = "microchip,qt1050", },
@@ -586,7 +586,7 @@ static struct i2c_driver qt1050_driver = {
 	.driver	= {
 		.name = "qt1050",
 		.of_match_table = of_match_ptr(qt1050_of_match),
-		.pm = &qt1050_pm_ops,
+		.pm = pm_sleep_ptr(&qt1050_pm_ops),
 	},
 	.probe_new = qt1050_probe,
 };
Signature · 1 line
2.38.1
Reviewed-by on v1 10/32
#14 lore raw

Re: [PATCH 10/32] Input: qt1050 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

Hi Jonathan,

thanks for the patch.

Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 11/32 Input: spear-keyboard - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/spear-keyboard.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/input/keyboard/spear-keyboard.c +5 -4
index 9838c79cb288..4bb7c533147c 100644
@@ -284,7 +284,7 @@ static int spear_kbd_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused spear_kbd_suspend(struct device *dev)
+static int spear_kbd_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct spear_kbd *kbd = platform_get_drvdata(pdev);
@@ -337,7 +337,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused spear_kbd_resume(struct device *dev)
+static int spear_kbd_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct spear_kbd *kbd = platform_get_drvdata(pdev);
@@ -364,7 +364,8 @@ static int __maybe_unused spear_kbd_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops,
+				spear_kbd_suspend, spear_kbd_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id spear_kbd_id_table[] = {
@@ -379,7 +380,7 @@ static struct platform_driver spear_kbd_driver = {
 	.remove		= spear_kbd_remove,
 	.driver		= {
 		.name	= "keyboard",
-		.pm	= &spear_kbd_pm_ops,
+		.pm	= pm_sleep_ptr(&spear_kbd_pm_ops),
 		.of_match_table = of_match_ptr(spear_kbd_id_table),
 	},
 };
Signature · 1 line
2.38.1
#16 lore raw

PATCH 12/32 Input: tm2-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/tm2-touchkey.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/keyboard/tm2-touchkey.c +5 -5
index 086aafaf0418..6627e65f06e5 100644
@@ -297,7 +297,7 @@ static int tm2_touchkey_probe(struct i2c_client *client)
 	return 0;
 }
 
-static int __maybe_unused tm2_touchkey_suspend(struct device *dev)
+static int tm2_touchkey_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
@@ -308,7 +308,7 @@ static int __maybe_unused tm2_touchkey_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused tm2_touchkey_resume(struct device *dev)
+static int tm2_touchkey_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
@@ -323,8 +323,8 @@ static int __maybe_unused tm2_touchkey_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
-			 tm2_touchkey_suspend, tm2_touchkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
+				tm2_touchkey_suspend, tm2_touchkey_resume);
 
 static const struct i2c_device_id tm2_touchkey_id_table[] = {
 	{ TM2_TOUCHKEY_DEV_NAME, 0 },
@@ -353,7 +353,7 @@ MODULE_DEVICE_TABLE(of, tm2_touchkey_of_match);
 static struct i2c_driver tm2_touchkey_driver = {
 	.driver = {
 		.name = TM2_TOUCHKEY_DEV_NAME,
-		.pm = &tm2_touchkey_pm_ops,
+		.pm = pm_sleep_ptr(&tm2_touchkey_pm_ops),
 		.of_match_table = of_match_ptr(tm2_touchkey_of_match),
 	},
 	.probe_new = tm2_touchkey_probe,
Signature · 1 line
2.38.1
#17 lore raw

PATCH 13/32 Input: lm8323 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 14/32 Input: lpc32xx-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 15/32 Input: matrix-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 16/32 Input: max7359-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 17/32 Input: mcs-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 18/32 Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/nomadik-ske-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/keyboard/nomadik-ske-keypad.c +3 -5
index 0d55a95347f1..970f2a671c2e 100644
@@ -388,7 +388,6 @@ static int ske_keypad_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int ske_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -416,15 +415,14 @@ static int ske_keypad_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
-			 ske_keypad_suspend, ske_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
+				ske_keypad_suspend, ske_keypad_resume);
 
 static struct platform_driver ske_keypad_driver = {
 	.driver = {
 		.name = "nmk-ske-keypad",
-		.pm = &ske_keypad_dev_pm_ops,
+		.pm = pm_sleep_ptr(&ske_keypad_dev_pm_ops),
 	},
 	.remove = ske_keypad_remove,
 };
Signature · 1 line
2.38.1
Acked-by on v1 18/32
#23 lore raw

Re: [PATCH 18/32] Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

Yours,
Linus Walleij

#24 lore raw

PATCH 19/32 Input: pmic8xxx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/pmic8xxx-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/keyboard/pmic8xxx-keypad.c +3 -5
index 4766c5048ce2..26a005f9ace3 100644
@@ -621,7 +621,6 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int pmic8xxx_kp_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -661,10 +660,9 @@ static int pmic8xxx_kp_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
-			 pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
+				pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
 
 static const struct of_device_id pm8xxx_match_table[] = {
 	{ .compatible = "qcom,pm8058-keypad" },
@@ -677,7 +675,7 @@ static struct platform_driver pmic8xxx_kp_driver = {
 	.probe		= pmic8xxx_kp_probe,
 	.driver		= {
 		.name = "pm8xxx-keypad",
-		.pm = &pm8xxx_kp_pm_ops,
+		.pm = pm_sleep_ptr(&pm8xxx_kp_pm_ops),
 		.of_match_table = pm8xxx_match_table,
 	},
 };
Signature · 1 line
2.38.1
#25 lore raw

PATCH 20/32 Input: pxa27x_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/pxa27x_keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/keyboard/pxa27x_keypad.c +3 -5
index a7f8257c8a02..871f858d0ba7 100644
@@ -660,7 +660,6 @@ static void pxa27x_keypad_close(struct input_dev *dev)
 	clk_disable_unprepare(keypad->clk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int pxa27x_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -706,10 +705,9 @@ static int pxa27x_keypad_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
-			 pxa27x_keypad_suspend, pxa27x_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
+				pxa27x_keypad_suspend, pxa27x_keypad_resume);
 
 
 static int pxa27x_keypad_probe(struct platform_device *pdev)
@@ -830,7 +828,7 @@ static struct platform_driver pxa27x_keypad_driver = {
 	.driver		= {
 		.name	= "pxa27x-keypad",
 		.of_match_table = of_match_ptr(pxa27x_keypad_dt_match),
-		.pm	= &pxa27x_keypad_pm_ops,
+		.pm	= pm_sleep_ptr(&pxa27x_keypad_pm_ops),
 	},
 };
 module_platform_driver(pxa27x_keypad_driver);
Signature · 1 line
2.38.1
#26 lore raw

PATCH 21/32 Input: qt1070 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 22/32 Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/sh_keysc.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/keyboard/sh_keysc.c +3 -5
index c155adebf96e..2c00320f739f 100644
@@ -283,7 +283,6 @@ static int sh_keysc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sh_keysc_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -316,17 +315,16 @@ static int sh_keysc_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
-			 sh_keysc_suspend, sh_keysc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
+				sh_keysc_suspend, sh_keysc_resume);
 
 static struct platform_driver sh_keysc_device_driver = {
 	.probe		= sh_keysc_probe,
 	.remove		= sh_keysc_remove,
 	.driver		= {
 		.name	= "sh_keysc",
-		.pm	= &sh_keysc_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&sh_keysc_dev_pm_ops),
 	}
 };
 module_platform_driver(sh_keysc_device_driver);
Signature · 1 line
2.38.1
#28 lore raw

PATCH 23/32 Input: st-keyscan - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 24/32 Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/tc3589x-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/keyboard/tc3589x-keypad.c +3 -5
index 78e55318ccd6..b0d86621c60a 100644
@@ -455,7 +455,6 @@ static int tc3589x_keypad_probe(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tc3589x_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -492,15 +491,14 @@ static int tc3589x_keypad_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops,
-			 tc3589x_keypad_suspend, tc3589x_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops,
+				tc3589x_keypad_suspend, tc3589x_keypad_resume);
 
 static struct platform_driver tc3589x_keypad_driver = {
 	.driver	= {
 		.name	= "tc3589x-keypad",
-		.pm	= &tc3589x_keypad_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&tc3589x_keypad_dev_pm_ops),
 	},
 	.probe	= tc3589x_keypad_probe,
 };
Signature · 1 line
2.38.1
#30 lore raw

PATCH 25/32 Input: tca6416-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

---
 drivers/input/keyboard/tca6416-keypad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/keyboard/tca6416-keypad.c +3 -5
index 281d9ec163cc..673b905af6fe 100644
@@ -320,7 +320,6 @@ static void tca6416_keypad_remove(struct i2c_client *client)
 	kfree(chip);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tca6416_keypad_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -342,15 +341,14 @@ static int tca6416_keypad_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
-			 tca6416_keypad_suspend, tca6416_keypad_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
+				tca6416_keypad_suspend, tca6416_keypad_resume);
 
 static struct i2c_driver tca6416_keypad_driver = {
 	.driver = {
 		.name	= "tca6416-keypad",
-		.pm	= &tca6416_keypad_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&tca6416_keypad_dev_pm_ops),
 	},
 	.probe_new	= tca6416_keypad_probe,
 	.remove		= tca6416_keypad_remove,
Signature · 1 line
2.38.1
#31 lore raw

PATCH 26/32 Input: tegra-kbc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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.

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

PATCH 27/32 Input: tegra-kbc - allow build with COMPILE_TEST

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Used to build test PM changes.

---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/Kconfig +1 -1
index 00292118b79b..28a9ad8a1466 100644
@@ -508,7 +508,7 @@ config KEYBOARD_NSPIRE
 
 config KEYBOARD_TEGRA
 	tristate "NVIDIA Tegra internal matrix keyboard controller support"
-	depends on ARCH_TEGRA && OF
+	depends on (ARCH_TEGRA && OF) || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use a matrix keyboard connected directly
Signature · 1 line
2.38.1
#33 lore raw

PATCH 28/32 Input: spear-keyboard - improve build coverage using COMPILE_TEST

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Used to test the PM changes.

---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/Kconfig +1 -1
index 28a9ad8a1466..39717a2e1757 100644
@@ -709,7 +709,7 @@ config KEYBOARD_OMAP4
 
 config KEYBOARD_SPEAR
 	tristate "ST SPEAR keyboard support"
-	depends on PLAT_SPEAR
+	depends on PLAT_SPEAR || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use the SPEAR keyboard.
Signature · 1 line
2.38.1
#34 lore raw

PATCH 29/32 Input: pxa27xx-keypad - allow build with COMPILE_TEST

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Used to build test PM changes.

---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/Kconfig +1 -1
index 39717a2e1757..1a949445f116 100644
@@ -542,7 +542,7 @@ config KEYBOARD_PINEPHONE
 
 config KEYBOARD_PXA27x
 	tristate "PXA27x/PXA3xx keypad support"
-	depends on PXA27x || PXA3xx || ARCH_MMP
+	depends on PXA27x || PXA3xx || ARCH_MMP || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Enable support for PXA27x/PXA3xx keypad controller.
Signature · 1 line
2.38.1
#35 lore raw

PATCH 30/32 Input: nomadik-ske-keypad - allow building with COMPILE_TEST

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Used to build test the PM changes.

---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/Kconfig +1 -1
index 1a949445f116..3f232d727e31 100644
@@ -487,7 +487,7 @@ config KEYBOARD_NEWTON
 
 config KEYBOARD_NOMADIK
 	tristate "ST-Ericsson Nomadik SKE keyboard"
-	depends on (ARCH_NOMADIK || ARCH_U8500)
+	depends on (ARCH_NOMADIK || ARCH_U8500 || COMPILE_TEST)
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use a keypad provided on the SKE controller
Signature · 1 line
2.38.1
#36 lore raw

PATCH 31/32 Input: lpc32xx - allow building with COMPILE_TEST

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Used to test the PM changes.

---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/Kconfig +1 -1
index 3f232d727e31..84490915ae4d 100644
@@ -390,7 +390,7 @@ config KEYBOARD_LOCOMO
 
 config KEYBOARD_LPC32XX
 	tristate "LPC32XX matrix key scanner support"
-	depends on ARCH_LPC32XX && OF
+	depends on (ARCH_LPC32XX && OF) || COMPILE_TEST
 	select INPUT_MATRIXKMAP
 	help
 	  Say Y here if you want to use NXP LPC32XX SoC key scanner interface,
Signature · 1 line
2.38.1
#37 lore raw

PATCH 32/32 Input: pxspad: Fix unused data warning when force feedback not enabled.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

Cc Tomohiro Yoshidomi <[email protected]>
---
 drivers/input/joystick/psxpad-spi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/input/joystick/psxpad-spi.c +3 -0
index 2c395af13d42..de734a927b4d 100644
@@ -44,6 +44,8 @@ static const u8 PSX_CMD_POLL[] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
+
+#ifdef CONFIG_JOYSTICK_PSXPAD_SPI_FF
 /*	0x01, 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 */
 static const u8 PSX_CMD_ENTER_CFG[] = {
 	0x80, 0xC2, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
@@ -56,6 +58,7 @@ static const u8 PSX_CMD_EXIT_CFG[] = {
 static const u8 PSX_CMD_ENABLE_MOTOR[]	= {
 	0x80, 0xB2, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF
 };
+#endif /* CONFIG_JOYSTICK_PSXPAD_SPI_FF */
 
 struct psxpad {
 	struct spi_device *spi;
Signature · 1 line
2.38.1
maintainer
#38 lore raw
In reply to Jonathan Cameron
Quoted 21 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

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

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

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

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

Quoted 7 lines

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

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

Applied the lot, thank you.

Signature · 1 line
Dmitry