All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/28] mfd: Remove #ifdef guards for PM functions
@ 2022-08-07 14:52 Paul Cercueil
  2022-08-07 14:52 ` [PATCH 01/28] mfd: 88pm80x: Remove #ifdef guards for PM related functions Paul Cercueil
                   ` (27 more replies)
  0 siblings, 28 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Hi Lee,

Here is a set of 28 patches that should convert all MFD drivers to use
the proper PM macros introduced recently.

These macros allow the PM related functions to be automatically dropped
by the compiler when CONFIG_SUSPEND or CONFIG_PM is disabled, without
having to use #ifdef guards.

The rationale behind this change, is that these functions are now
always compiled independently of any Kconfig option, and thanks to that
bugs and regressions are easier to catch.

Most of the changes are trivial. Some patches come with a caveat:
- patch 06/28 moves the PM functions to pcf50633-irq.c, and uses
  EXPORT_GPL_SIMPLE_DEV_PM_OPS(). This means that we're now exporting a
  symbol that wasn't exported before. This is the only solution I found
  in order to have all PM related functions dropped in case PM is
  disabled.
- patch 12/28 was not compile-tested (all other were) since it doesn't
  build on x86. The change is trivial though, so there's no reason why
  it wouldn't compile.
- patch 14, 15, 19 and 28 use (platform_driver.suspend) instead of
  (platform_driver.driver.pm.suspend). Is the former deprecated?
  The scope of this patchset is just to convert to the new PM macros,
  but it left me wondering if this should be using the standard
  dev_pm_ops structure instead.
- patch 17/28 could probably use DEFINE_RUNTIME_DEV_PM_OPS(), which
  registers pm_runtime_force_suspend() and pm_runtime_force_resume() as
  the .suspend/.resume callbacks. I didn't know if the callbacks were
  missing on purpose, so I chose not to use this macro.
- patch 20/28 is a bit messy, because the EXPORT_GPL_SIMPLE_DEV_PM_OPS()
  does not support noirq callbacks. If you think it looks too bad, we
  can maybe add a new PM macro to handle this case.
- patch 26/28 exports the "stmpe_dev_pm_ops", which wasn't exported
  before. If you think this is a problem, we can export the symbol to a
  stmpe namespace.

Cheers,
-Paul

Paul Cercueil (28):
  mfd: 88pm80x: Remove #ifdef guards for PM related functions
  mfd: aat2870: Remove #ifdef guards for PM related functions
  mfd: adp5520: Remove #ifdef guards for PM related functions
  mfd: max8925-i2c: Remove #ifdef guards for PM related functions
  mfd: mt6397-irq: Remove #ifdef guards for PM related functions
  mfd: pcf50633: Remove #ifdef guards for PM related functions
  mfd: rc5t583-irq: Remove #ifdef guards for PM related functions
  mfd: stpmic1: Remove #ifdef guards for PM related functions
  mfd: ucb1x00: Remove #ifdef guards for PM related functions
  mfd: 88pm860x: Remove #ifdef guards for PM related functions
  mfd: intel_soc_pmic: Remove #ifdef guards for PM related functions
  mfd: mcp-sa11x0: Remove #ifdef guards for PM related functions
  mfd: sec: Remove #ifdef guards for PM related functions
  mfd: sm501: Remove #ifdef guards for PM related functions
  mfd: tc6387xb: Remove #ifdef guards for PM related functions
  mfd: tps6586x: Remove #ifdef guards for PM related functions
  mfd: wm8994: Remove #ifdef guards for PM related functions
  mfd: max77620: Remove #ifdef guards for PM related functions
  mfd: t7l66xb: Remove #ifdef guards for PM related functions
  mfd: arizona: Remove #ifdef guards for PM related functions
  mfd: max14577: Remove #ifdef guards for PM related functions
  mfd: max77686: Remove #ifdef guards for PM related functions
  mfd: motorola-cpcap: Remove #ifdef guards for PM related functions
  mfd: sprd-sc27xx: Remove #ifdef guards for PM related functions
  mfd: stmfx: Remove #ifdef guards for PM related functions
  mfd: stmpe: Remove #ifdef guards for PM related functions
  mfd: tc3589x: Remove #ifdef guards for PM related functions
  mfd: tc6393xb: Remove #ifdef guards for PM related functions

 drivers/mfd/88pm800.c              |  2 +-
 drivers/mfd/88pm805.c              |  2 +-
 drivers/mfd/88pm80x.c              |  5 +----
 drivers/mfd/88pm860x-core.c        |  6 ++----
 drivers/mfd/aat2870-core.c         |  8 +++-----
 drivers/mfd/adp5520.c              |  6 ++----
 drivers/mfd/arizona-core.c         | 21 +++++++++++----------
 drivers/mfd/arizona-i2c.c          |  2 +-
 drivers/mfd/arizona-spi.c          |  2 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c |  7 +++----
 drivers/mfd/intel_soc_pmic_core.c  |  8 +++-----
 drivers/mfd/max14577.c             |  6 ++----
 drivers/mfd/max77620.c             |  9 +++------
 drivers/mfd/max77686.c             |  6 ++----
 drivers/mfd/max8925-i2c.c          |  7 +++----
 drivers/mfd/mcp-sa11x0.c           |  6 +-----
 drivers/mfd/motorola-cpcap.c       |  6 ++----
 drivers/mfd/mt6397-irq.c           |  6 +-----
 drivers/mfd/pcf50633-core.c        | 22 +---------------------
 drivers/mfd/pcf50633-irq.c         | 13 ++++++++-----
 drivers/mfd/rc5t583-irq.c          |  7 ++-----
 drivers/mfd/sec-core.c             |  7 +++----
 drivers/mfd/sm501.c                | 10 ++--------
 drivers/mfd/sprd-sc27xx-spi.c      |  7 +++----
 drivers/mfd/stmfx.c                |  6 ++----
 drivers/mfd/stmpe-i2c.c            |  4 +---
 drivers/mfd/stmpe-spi.c            |  4 +---
 drivers/mfd/stmpe.c                |  8 ++------
 drivers/mfd/stpmic1.c              |  6 ++----
 drivers/mfd/t7l66xb.c              |  9 ++-------
 drivers/mfd/tc3589x.c              |  7 +++----
 drivers/mfd/tc6387xb.c             |  9 ++-------
 drivers/mfd/tc6393xb.c             |  9 ++-------
 drivers/mfd/tps6586x.c             |  6 +-----
 drivers/mfd/ucb1x00-core.c         |  7 +++----
 drivers/mfd/wm8994-core.c          |  6 ++----
 include/linux/mfd/pcf50633/core.h  |  6 ++----
 37 files changed, 87 insertions(+), 181 deletions(-)

-- 
2.35.1


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

* [PATCH 01/28] mfd: 88pm80x: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 02/28] mfd: aat2870: " Paul Cercueil
                   ` (26 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new EXPORT_GPL_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/88pm800.c | 2 +-
 drivers/mfd/88pm805.c | 2 +-
 drivers/mfd/88pm80x.c | 5 +----
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c
index eaf9845633b4..409f0996ae1d 100644
--- a/drivers/mfd/88pm800.c
+++ b/drivers/mfd/88pm800.c
@@ -599,7 +599,7 @@ static int pm800_remove(struct i2c_client *client)
 static struct i2c_driver pm800_driver = {
 	.driver = {
 		.name = "88PM800",
-		.pm = &pm80x_pm_ops,
+		.pm = pm_sleep_ptr(&pm80x_pm_ops),
 		},
 	.probe = pm800_probe,
 	.remove = pm800_remove,
diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c
index ada6c513302b..724ac4947e6f 100644
--- a/drivers/mfd/88pm805.c
+++ b/drivers/mfd/88pm805.c
@@ -254,7 +254,7 @@ static int pm805_remove(struct i2c_client *client)
 static struct i2c_driver pm805_driver = {
 	.driver = {
 		.name = "88PM805",
-		.pm = &pm80x_pm_ops,
+		.pm = pm_sleep_ptr(&pm80x_pm_ops),
 		},
 	.probe = pm805_probe,
 	.remove = pm805_remove,
diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c
index be036e7e787b..ac4f08565f29 100644
--- a/drivers/mfd/88pm80x.c
+++ b/drivers/mfd/88pm80x.c
@@ -129,7 +129,6 @@ int pm80x_deinit(void)
 }
 EXPORT_SYMBOL_GPL(pm80x_deinit);
 
-#ifdef CONFIG_PM_SLEEP
 static int pm80x_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -153,10 +152,8 @@ static int pm80x_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-SIMPLE_DEV_PM_OPS(pm80x_pm_ops, pm80x_suspend, pm80x_resume);
-EXPORT_SYMBOL_GPL(pm80x_pm_ops);
+EXPORT_GPL_SIMPLE_DEV_PM_OPS(pm80x_pm_ops, pm80x_suspend, pm80x_resume);
 
 MODULE_DESCRIPTION("I2C Driver for Marvell 88PM80x");
 MODULE_AUTHOR("Qiao Zhou <zhouqiao@marvell.com>");
-- 
2.35.1


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

* [PATCH 02/28] mfd: aat2870: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
  2022-08-07 14:52 ` [PATCH 01/28] mfd: 88pm80x: Remove #ifdef guards for PM related functions Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 03/28] mfd: adp5520: " Paul Cercueil
                   ` (25 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/aat2870-core.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index a17cf759739d..8a3967c3f026 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -409,7 +409,6 @@ static int aat2870_i2c_probe(struct i2c_client *client,
 	return ret;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int aat2870_i2c_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -438,10 +437,9 @@ static int aat2870_i2c_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
-			 aat2870_i2c_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
+				aat2870_i2c_resume);
 
 static const struct i2c_device_id aat2870_i2c_id_table[] = {
 	{ "aat2870", 0 },
@@ -451,7 +449,7 @@ static const struct i2c_device_id aat2870_i2c_id_table[] = {
 static struct i2c_driver aat2870_i2c_driver = {
 	.driver = {
 		.name			= "aat2870",
-		.pm			= &aat2870_pm_ops,
+		.pm			= pm_sleep_ptr(&aat2870_pm_ops),
 		.suppress_bind_attrs	= true,
 	},
 	.probe		= aat2870_i2c_probe,
-- 
2.35.1


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

* [PATCH 03/28] mfd: adp5520: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
  2022-08-07 14:52 ` [PATCH 01/28] mfd: 88pm80x: Remove #ifdef guards for PM related functions Paul Cercueil
  2022-08-07 14:52 ` [PATCH 02/28] mfd: aat2870: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-08  7:46   ` Hennerich, Michael
  2022-08-07 14:52 ` [PATCH 04/28] mfd: max8925-i2c: " Paul Cercueil
                   ` (24 subsequent siblings)
  27 siblings, 1 reply; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil, Michael Hennerich

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/mfd/adp5520.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index 8db15f5a7179..882eddc32f8e 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -305,7 +305,6 @@ static int adp5520_probe(struct i2c_client *client,
 	return ret;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int adp5520_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -326,9 +325,8 @@ static int adp5520_resume(struct device *dev)
 	adp5520_write(chip->dev, ADP5520_MODE_STATUS, chip->mode);
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend, adp5520_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend, adp5520_resume);
 
 static const struct i2c_device_id adp5520_id[] = {
 	{ "pmic-adp5520", ID_ADP5520 },
@@ -339,7 +337,7 @@ static const struct i2c_device_id adp5520_id[] = {
 static struct i2c_driver adp5520_driver = {
 	.driver = {
 		.name			= "adp5520",
-		.pm			= &adp5520_pm,
+		.pm			= pm_sleep_ptr(&adp5520_pm),
 		.suppress_bind_attrs	= true,
 	},
 	.probe		= adp5520_probe,
-- 
2.35.1


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

* [PATCH 04/28] mfd: max8925-i2c: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (2 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 03/28] mfd: adp5520: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52   ` Paul Cercueil
                   ` (23 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/max8925-i2c.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index 114e905bef25..649310b5bb3e 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -208,7 +208,6 @@ static int max8925_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max8925_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -228,9 +227,9 @@ static int max8925_resume(struct device *dev)
 		disable_irq_wake(chip->core_irq);
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(max8925_pm_ops, max8925_suspend, max8925_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max8925_pm_ops,
+				max8925_suspend, max8925_resume);
 
 static const struct of_device_id max8925_dt_ids[] = {
 	{ .compatible = "maxim,max8925", },
@@ -240,7 +239,7 @@ static const struct of_device_id max8925_dt_ids[] = {
 static struct i2c_driver max8925_driver = {
 	.driver	= {
 		.name	= "max8925",
-		.pm     = &max8925_pm_ops,
+		.pm     = pm_sleep_ptr(&max8925_pm_ops),
 		.of_match_table = max8925_dt_ids,
 	},
 	.probe		= max8925_probe,
-- 
2.35.1


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

* [PATCH 05/28] mfd: mt6397-irq: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
@ 2022-08-07 14:52   ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 02/28] mfd: aat2870: " Paul Cercueil
                     ` (26 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Matthias Brugger, linux-arm-kernel,
	linux-mediatek

Use the new pm_sleep_ptr() macro to handle the .irq_set_wake() callback.

This macro allows the mt6397_irq_set_wake() function to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
---
 drivers/mfd/mt6397-irq.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c
index 2924919da991..69009d119216 100644
--- a/drivers/mfd/mt6397-irq.c
+++ b/drivers/mfd/mt6397-irq.c
@@ -52,7 +52,6 @@ static void mt6397_irq_enable(struct irq_data *data)
 	mt6397->irq_masks_cur[reg] |= BIT(shift);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 {
 	struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(irq_data);
@@ -66,9 +65,6 @@ static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 
 	return 0;
 }
-#else
-#define mt6397_irq_set_wake NULL
-#endif
 
 static struct irq_chip mt6397_irq_chip = {
 	.name = "mt6397-irq",
@@ -76,7 +72,7 @@ static struct irq_chip mt6397_irq_chip = {
 	.irq_bus_sync_unlock = mt6397_irq_sync_unlock,
 	.irq_enable = mt6397_irq_enable,
 	.irq_disable = mt6397_irq_disable,
-	.irq_set_wake = mt6397_irq_set_wake,
+	.irq_set_wake = pm_sleep_ptr(mt6397_irq_set_wake),
 };
 
 static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg,
-- 
2.35.1


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

* [PATCH 05/28] mfd: mt6397-irq: Remove #ifdef guards for PM related functions
@ 2022-08-07 14:52   ` Paul Cercueil
  0 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Matthias Brugger, linux-arm-kernel,
	linux-mediatek

Use the new pm_sleep_ptr() macro to handle the .irq_set_wake() callback.

This macro allows the mt6397_irq_set_wake() function to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
---
 drivers/mfd/mt6397-irq.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c
index 2924919da991..69009d119216 100644
--- a/drivers/mfd/mt6397-irq.c
+++ b/drivers/mfd/mt6397-irq.c
@@ -52,7 +52,6 @@ static void mt6397_irq_enable(struct irq_data *data)
 	mt6397->irq_masks_cur[reg] |= BIT(shift);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 {
 	struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(irq_data);
@@ -66,9 +65,6 @@ static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 
 	return 0;
 }
-#else
-#define mt6397_irq_set_wake NULL
-#endif
 
 static struct irq_chip mt6397_irq_chip = {
 	.name = "mt6397-irq",
@@ -76,7 +72,7 @@ static struct irq_chip mt6397_irq_chip = {
 	.irq_bus_sync_unlock = mt6397_irq_sync_unlock,
 	.irq_enable = mt6397_irq_enable,
 	.irq_disable = mt6397_irq_disable,
-	.irq_set_wake = mt6397_irq_set_wake,
+	.irq_set_wake = pm_sleep_ptr(mt6397_irq_set_wake),
 };
 
 static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg,
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 06/28] mfd: pcf50633: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (4 preceding siblings ...)
  2022-08-07 14:52   ` Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 07/28] mfd: rc5t583-irq: " Paul Cercueil
                   ` (21 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new EXPORT_GPL_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/pcf50633-core.c       | 22 +---------------------
 drivers/mfd/pcf50633-irq.c        | 13 ++++++++-----
 include/linux/mfd/pcf50633/core.h |  6 ++----
 3 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index e9c565cf0f54..06d750d9a476 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -158,26 +158,6 @@ pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int pcf50633_suspend(struct device *dev)
-{
-	struct i2c_client *client = to_i2c_client(dev);
-	struct pcf50633 *pcf = i2c_get_clientdata(client);
-
-	return pcf50633_irq_suspend(pcf);
-}
-
-static int pcf50633_resume(struct device *dev)
-{
-	struct i2c_client *client = to_i2c_client(dev);
-	struct pcf50633 *pcf = i2c_get_clientdata(client);
-
-	return pcf50633_irq_resume(pcf);
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
-
 static const struct regmap_config pcf50633_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
@@ -302,7 +282,7 @@ MODULE_DEVICE_TABLE(i2c, pcf50633_id_table);
 static struct i2c_driver pcf50633_driver = {
 	.driver = {
 		.name	= "pcf50633",
-		.pm	= &pcf50633_pm,
+		.pm	= pm_sleep_ptr(&pcf50633_pm),
 	},
 	.id_table = pcf50633_id_table,
 	.probe = pcf50633_probe,
diff --git a/drivers/mfd/pcf50633-irq.c b/drivers/mfd/pcf50633-irq.c
index 2096afb0ce9b..e85af7f1cb0b 100644
--- a/drivers/mfd/pcf50633-irq.c
+++ b/drivers/mfd/pcf50633-irq.c
@@ -7,6 +7,7 @@
  * All rights reserved.
  */
 
+#include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/mutex.h>
@@ -218,10 +219,10 @@ static irqreturn_t pcf50633_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_PM
-
-int pcf50633_irq_suspend(struct pcf50633 *pcf)
+static int pcf50633_suspend(struct device *dev)
 {
+	struct i2c_client *client = to_i2c_client(dev);
+	struct pcf50633 *pcf = i2c_get_clientdata(client);
 	int ret;
 	int i;
 	u8 res[5];
@@ -257,8 +258,10 @@ int pcf50633_irq_suspend(struct pcf50633 *pcf)
 	return ret;
 }
 
-int pcf50633_irq_resume(struct pcf50633 *pcf)
+static int pcf50633_resume(struct device *dev)
 {
+	struct i2c_client *client = to_i2c_client(dev);
+	struct pcf50633 *pcf = i2c_get_clientdata(client);
 	int ret;
 
 	/* Write the saved mask registers */
@@ -273,7 +276,7 @@ int pcf50633_irq_resume(struct pcf50633 *pcf)
 	return ret;
 }
 
-#endif
+EXPORT_GPL_SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
 
 int pcf50633_irq_init(struct pcf50633 *pcf, int irq)
 {
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 3f752dc62a6c..539f27f8bd89 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -13,6 +13,7 @@
 #include <linux/workqueue.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/pm.h>
 #include <linux/power_supply.h>
 #include <linux/mfd/pcf50633/backlight.h>
 
@@ -226,9 +227,6 @@ static inline struct pcf50633 *dev_to_pcf50633(struct device *dev)
 
 int pcf50633_irq_init(struct pcf50633 *pcf, int irq);
 void pcf50633_irq_free(struct pcf50633 *pcf);
-#ifdef CONFIG_PM
-int pcf50633_irq_suspend(struct pcf50633 *pcf);
-int pcf50633_irq_resume(struct pcf50633 *pcf);
-#endif
+extern const struct dev_pm_ops pcf50633_pm;
 
 #endif
-- 
2.35.1


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

* [PATCH 07/28] mfd: rc5t583-irq: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (5 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 06/28] mfd: pcf50633: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 08/28] mfd: stpmic1: " Paul Cercueil
                   ` (20 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new pm_sleep_ptr() macro to handle the .irq_set_wake() callback.

This macro allows the mt6397_irq_set_wake() function to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/rc5t583-irq.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/rc5t583-irq.c b/drivers/mfd/rc5t583-irq.c
index b374a3d34688..621ea61fa7c6 100644
--- a/drivers/mfd/rc5t583-irq.c
+++ b/drivers/mfd/rc5t583-irq.c
@@ -228,15 +228,12 @@ static void rc5t583_irq_sync_unlock(struct irq_data *irq_data)
 
 	mutex_unlock(&rc5t583->irq_lock);
 }
-#ifdef CONFIG_PM_SLEEP
+
 static int rc5t583_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 {
 	struct rc5t583 *rc5t583 = irq_data_get_irq_chip_data(irq_data);
 	return irq_set_irq_wake(rc5t583->chip_irq, on);
 }
-#else
-#define rc5t583_irq_set_wake NULL
-#endif
 
 static irqreturn_t rc5t583_irq(int irq, void *data)
 {
@@ -317,7 +314,7 @@ static struct irq_chip rc5t583_irq_chip = {
 	.irq_bus_lock = rc5t583_irq_lock,
 	.irq_bus_sync_unlock = rc5t583_irq_sync_unlock,
 	.irq_set_type = rc5t583_irq_set_type,
-	.irq_set_wake = rc5t583_irq_set_wake,
+	.irq_set_wake = pm_sleep_ptr(rc5t583_irq_set_wake),
 };
 
 int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base)
-- 
2.35.1


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

* [PATCH 08/28] mfd: stpmic1: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (6 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 07/28] mfd: rc5t583-irq: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 09/28] mfd: ucb1x00: " Paul Cercueil
                   ` (19 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/stpmic1.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/stpmic1.c b/drivers/mfd/stpmic1.c
index eb3da558c3fb..7d8b0c0548fe 100644
--- a/drivers/mfd/stpmic1.c
+++ b/drivers/mfd/stpmic1.c
@@ -162,7 +162,6 @@ static int stpmic1_probe(struct i2c_client *i2c,
 	return devm_of_platform_populate(dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int stpmic1_suspend(struct device *dev)
 {
 	struct i2c_client *i2c = to_i2c_client(dev);
@@ -187,9 +186,8 @@ static int stpmic1_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(stpmic1_pm, stpmic1_suspend, stpmic1_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stpmic1_pm, stpmic1_suspend, stpmic1_resume);
 
 static const struct of_device_id stpmic1_of_match[] = {
 	{ .compatible = "st,stpmic1", },
@@ -201,7 +199,7 @@ static struct i2c_driver stpmic1_driver = {
 	.driver = {
 		.name = "stpmic1",
 		.of_match_table = of_match_ptr(stpmic1_of_match),
-		.pm = &stpmic1_pm,
+		.pm = pm_sleep_ptr(&stpmic1_pm),
 	},
 	.probe = stpmic1_probe,
 };
-- 
2.35.1


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

* [PATCH 09/28] mfd: ucb1x00: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (7 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 08/28] mfd: stpmic1: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 10/28] mfd: 88pm860x: " Paul Cercueil
                   ` (18 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/ucb1x00-core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index b690796d24d4..fc4d4c844a81 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -660,7 +660,6 @@ void ucb1x00_unregister_driver(struct ucb1x00_driver *drv)
 	mutex_unlock(&ucb1x00_mutex);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int ucb1x00_suspend(struct device *dev)
 {
 	struct ucb1x00_plat_data *pdata = dev_get_platdata(dev);
@@ -728,15 +727,15 @@ static int ucb1x00_resume(struct device *dev)
 	mutex_unlock(&ucb1x00_mutex);
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(ucb1x00_pm_ops, ucb1x00_suspend, ucb1x00_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ucb1x00_pm_ops,
+				ucb1x00_suspend, ucb1x00_resume);
 
 static struct mcp_driver ucb1x00_driver = {
 	.drv		= {
 		.name	= "ucb1x00",
 		.owner	= THIS_MODULE,
-		.pm	= &ucb1x00_pm_ops,
+		.pm	= pm_sleep_ptr(&ucb1x00_pm_ops),
 	},
 	.probe		= ucb1x00_probe,
 	.remove		= ucb1x00_remove,
-- 
2.35.1


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

* [PATCH 10/28] mfd: 88pm860x: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (8 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 09/28] mfd: ucb1x00: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 11/28] mfd: intel_soc_pmic: " Paul Cercueil
                   ` (17 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/88pm860x-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index b1e829ea909b..b698eb59041e 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1213,7 +1213,6 @@ static int pm860x_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int pm860x_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -1233,9 +1232,8 @@ static int pm860x_resume(struct device *dev)
 		disable_irq_wake(chip->core_irq);
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
 
 static const struct i2c_device_id pm860x_id_table[] = {
 	{ "88PM860x", 0 },
@@ -1252,7 +1250,7 @@ MODULE_DEVICE_TABLE(of, pm860x_dt_ids);
 static struct i2c_driver pm860x_driver = {
 	.driver	= {
 		.name	= "88PM860x",
-		.pm     = &pm860x_pm_ops,
+		.pm     = pm_sleep_ptr(&pm860x_pm_ops),
 		.of_match_table	= pm860x_dt_ids,
 	},
 	.probe_new	= pm860x_probe,
-- 
2.35.1


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

* [PATCH 11/28] mfd: intel_soc_pmic: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (9 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 10/28] mfd: 88pm860x: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 15:50   ` Andy Shevchenko
  2022-08-07 14:52 ` [PATCH 12/28] mfd: mcp-sa11x0: " Paul Cercueil
                   ` (16 subsequent siblings)
  27 siblings, 1 reply; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil, Andy Shevchenko

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Andy Shevchenko <andy@kernel.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +++----
 drivers/mfd/intel_soc_pmic_core.c  | 8 +++-----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index bc069c4daa60..7110d91f7ace 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -586,7 +586,6 @@ static void bxtwc_shutdown(struct platform_device *pdev)
 	disable_irq(pmic->irq);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int bxtwc_suspend(struct device *dev)
 {
 	struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
@@ -603,8 +602,8 @@ static int bxtwc_resume(struct device *dev)
 	enable_irq(pmic->irq);
 	return 0;
 }
-#endif
-static SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume);
+
+static DEFINE_SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume);
 
 static const struct acpi_device_id bxtwc_acpi_ids[] = {
 	{ "INT34D3", },
@@ -618,7 +617,7 @@ static struct platform_driver bxtwc_driver = {
 	.shutdown = bxtwc_shutdown,
 	.driver	= {
 		.name	= "BXTWC PMIC",
-		.pm     = &bxtwc_pm_ops,
+		.pm     = pm_sleep_ptr(&bxtwc_pm_ops),
 		.acpi_match_table = ACPI_PTR(bxtwc_acpi_ids),
 	},
 };
diff --git a/drivers/mfd/intel_soc_pmic_core.c b/drivers/mfd/intel_soc_pmic_core.c
index 5e8c94e008ed..96303aa87bc1 100644
--- a/drivers/mfd/intel_soc_pmic_core.c
+++ b/drivers/mfd/intel_soc_pmic_core.c
@@ -104,7 +104,6 @@ static void intel_soc_pmic_shutdown(struct i2c_client *i2c)
 	return;
 }
 
-#if defined(CONFIG_PM_SLEEP)
 static int intel_soc_pmic_suspend(struct device *dev)
 {
 	struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
@@ -122,10 +121,9 @@ static int intel_soc_pmic_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend,
-			 intel_soc_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend,
+				intel_soc_pmic_resume);
 
 static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
 	{ }
@@ -143,7 +141,7 @@ MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
 static struct i2c_driver intel_soc_pmic_i2c_driver = {
 	.driver = {
 		.name = "intel_soc_pmic_i2c",
-		.pm = &intel_soc_pmic_pm_ops,
+		.pm = pm_sleep_ptr(&intel_soc_pmic_pm_ops),
 		.acpi_match_table = ACPI_PTR(intel_soc_pmic_acpi_match),
 	},
 	.probe = intel_soc_pmic_i2c_probe,
-- 
2.35.1


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

* [PATCH 12/28] mfd: mcp-sa11x0: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (10 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 11/28] mfd: intel_soc_pmic: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 13/28] mfd: sec: " Paul Cercueil
                   ` (15 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new pm_sleep_ptr() macro to handle the .suspend/.resume
callbacks.

This macro allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/mcp-sa11x0.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index 4629dff187cd..1c9831b78cf9 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -255,7 +255,6 @@ static int mcp_sa11x0_remove(struct platform_device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mcp_sa11x0_suspend(struct device *dev)
 {
 	struct mcp_sa11x0 *m = priv(dev_get_drvdata(dev));
@@ -277,17 +276,14 @@ static int mcp_sa11x0_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops mcp_sa11x0_pm_ops = {
-#ifdef CONFIG_PM_SLEEP
 	.suspend = mcp_sa11x0_suspend,
 	.freeze = mcp_sa11x0_suspend,
 	.poweroff = mcp_sa11x0_suspend,
 	.resume_noirq = mcp_sa11x0_resume,
 	.thaw_noirq = mcp_sa11x0_resume,
 	.restore_noirq = mcp_sa11x0_resume,
-#endif
 };
 
 static struct platform_driver mcp_sa11x0_driver = {
@@ -295,7 +291,7 @@ static struct platform_driver mcp_sa11x0_driver = {
 	.remove		= mcp_sa11x0_remove,
 	.driver		= {
 		.name	= DRIVER_NAME,
-		.pm	= &mcp_sa11x0_pm_ops,
+		.pm	= pm_sleep_ptr(&mcp_sa11x0_pm_ops),
 	},
 };
 
-- 
2.35.1


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

* [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (11 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 12/28] mfd: mcp-sa11x0: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-08  9:11   ` Krzysztof Kozlowski
  2022-08-07 14:52 ` [PATCH 14/28] mfd: sm501: " Paul Cercueil
                   ` (14 subsequent siblings)
  27 siblings, 1 reply; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, linux-samsung-soc

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
---
 drivers/mfd/sec-core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 1fb29c45f5cf..a467de2b2fea 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -455,7 +455,6 @@ static void sec_pmic_shutdown(struct i2c_client *i2c)
 	regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sec_pmic_suspend(struct device *dev)
 {
 	struct i2c_client *i2c = to_i2c_client(dev);
@@ -488,14 +487,14 @@ static int sec_pmic_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops,
+				sec_pmic_suspend, sec_pmic_resume);
 
 static struct i2c_driver sec_pmic_driver = {
 	.driver = {
 		   .name = "sec_pmic",
-		   .pm = &sec_pmic_pm_ops,
+		   .pm = pm_sleep_ptr(&sec_pmic_pm_ops),
 		   .of_match_table = sec_dt_match,
 	},
 	.probe = sec_pmic_probe,
-- 
2.35.1


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

* [PATCH 14/28] mfd: sm501: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (12 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 13/28] mfd: sec: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 15/28] mfd: tc6387xb: " Paul Cercueil
                   ` (13 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new pm_sleep_ptr() macro to handle the .suspend/.resume
callbacks.

This macro allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/sm501.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index bc0a2c38653e..81e15e646e77 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -1432,8 +1432,6 @@ static int sm501_plat_probe(struct platform_device *dev)
 
 }
 
-#ifdef CONFIG_PM
-
 /* power management support */
 
 static void sm501_set_power(struct sm501_devdata *sm, int on)
@@ -1509,10 +1507,6 @@ static int sm501_plat_resume(struct platform_device *pdev)
 
 	return 0;
 }
-#else
-#define sm501_plat_suspend NULL
-#define sm501_plat_resume NULL
-#endif
 
 /* Initialisation data for PCI devices */
 
@@ -1714,8 +1708,8 @@ static struct platform_driver sm501_plat_driver = {
 	},
 	.probe		= sm501_plat_probe,
 	.remove		= sm501_plat_remove,
-	.suspend	= sm501_plat_suspend,
-	.resume		= sm501_plat_resume,
+	.suspend	= pm_sleep_ptr(sm501_plat_suspend),
+	.resume		= pm_sleep_ptr(sm501_plat_resume),
 };
 
 static int __init sm501_base_init(void)
-- 
2.35.1


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

* [PATCH 15/28] mfd: tc6387xb: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (13 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 14/28] mfd: sm501: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 16/28] mfd: tps6586x: " Paul Cercueil
                   ` (12 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new pm_sleep_ptr() macro to handle the .suspend/.resume
callbacks.

This macro allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/tc6387xb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
index e846e4d26b6e..5392da6ba7b0 100644
--- a/drivers/mfd/tc6387xb.c
+++ b/drivers/mfd/tc6387xb.c
@@ -40,7 +40,6 @@ static const struct resource tc6387xb_mmc_resources[] = {
 
 /*--------------------------------------------------------------------------*/
 
-#ifdef CONFIG_PM
 static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
@@ -67,10 +66,6 @@ static int tc6387xb_resume(struct platform_device *dev)
 
 	return 0;
 }
-#else
-#define tc6387xb_suspend  NULL
-#define tc6387xb_resume   NULL
-#endif
 
 /*--------------------------------------------------------------------------*/
 
@@ -220,8 +215,8 @@ static struct platform_driver tc6387xb_platform_driver = {
 	},
 	.probe		= tc6387xb_probe,
 	.remove		= tc6387xb_remove,
-	.suspend        = tc6387xb_suspend,
-	.resume         = tc6387xb_resume,
+	.suspend        = pm_sleep_ptr(tc6387xb_suspend),
+	.resume         = pm_sleep_ptr(tc6387xb_resume),
 };
 
 module_platform_driver(tc6387xb_platform_driver);
-- 
2.35.1


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

* [PATCH 16/28] mfd: tps6586x: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (14 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 15/28] mfd: tc6387xb: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 17/28] mfd: wm8994: " Paul Cercueil
                   ` (11 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new pm_sleep_ptr() macro to handle the .irq_set_wake() callback.

This macro allows the mt6397_irq_set_wake() function to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/tps6586x.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index c9303d3d6602..fd57c3974615 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -269,15 +269,11 @@ static void tps6586x_irq_sync_unlock(struct irq_data *data)
 	mutex_unlock(&tps6586x->irq_lock);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tps6586x_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 {
 	struct tps6586x *tps6586x = irq_data_get_irq_chip_data(irq_data);
 	return irq_set_irq_wake(tps6586x->irq, on);
 }
-#else
-#define tps6586x_irq_set_wake NULL
-#endif
 
 static struct irq_chip tps6586x_irq_chip = {
 	.name = "tps6586x",
@@ -285,7 +281,7 @@ static struct irq_chip tps6586x_irq_chip = {
 	.irq_bus_sync_unlock = tps6586x_irq_sync_unlock,
 	.irq_disable = tps6586x_irq_disable,
 	.irq_enable = tps6586x_irq_enable,
-	.irq_set_wake = tps6586x_irq_set_wake,
+	.irq_set_wake = pm_sleep_ptr(tps6586x_irq_set_wake),
 };
 
 static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,
-- 
2.35.1


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

* [PATCH 17/28] mfd: wm8994: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (15 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 16/28] mfd: tps6586x: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 18/28] mfd: max77620: " Paul Cercueil
                   ` (10 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil, patches

Use the new RUNTIME_PM_OPS() and pm_ptr() macros to handle the
.runtime_suspend/.runtime_resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_PM is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Note that this driver should probably use the new
DEFINE_RUNTIME_DEV_PM_OPS() macro instead, which will provide
.suspend/.resume callbacks, pointing to pm_runtime_force_suspend() and
pm_runtime_force_resume() respectively; unless those callbacks really
aren't needed.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: patches@opensource.cirrus.com
---
 drivers/mfd/wm8994-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index 7b1d270722ba..a27a13b5ae1e 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -110,7 +110,6 @@ static const char *wm8958_main_supplies[] = {
 	"SPKVDD2",
 };
 
-#ifdef CONFIG_PM
 static int wm8994_suspend(struct device *dev)
 {
 	struct wm8994 *wm8994 = dev_get_drvdata(dev);
@@ -213,7 +212,6 @@ static int wm8994_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
 #ifdef CONFIG_REGULATOR
 static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
@@ -676,13 +674,13 @@ static const struct i2c_device_id wm8994_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, wm8994_i2c_id);
 
 static const struct dev_pm_ops wm8994_pm_ops = {
-	SET_RUNTIME_PM_OPS(wm8994_suspend, wm8994_resume, NULL)
+	RUNTIME_PM_OPS(wm8994_suspend, wm8994_resume, NULL)
 };
 
 static struct i2c_driver wm8994_i2c_driver = {
 	.driver = {
 		.name = "wm8994",
-		.pm = &wm8994_pm_ops,
+		.pm = pm_ptr(&wm8994_pm_ops),
 		.of_match_table = wm8994_of_match,
 	},
 	.probe = wm8994_i2c_probe,
-- 
2.35.1


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

* [PATCH 18/28] mfd: max77620: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (16 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 17/28] mfd: wm8994: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 19/28] mfd: t7l66xb: " Paul Cercueil
                   ` (9 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/max77620.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
index fec2096474ad..e8ee4b132fb7 100644
--- a/drivers/mfd/max77620.c
+++ b/drivers/mfd/max77620.c
@@ -574,7 +574,6 @@ static int max77620_probe(struct i2c_client *client,
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max77620_set_fps_period(struct max77620_chip *chip,
 				   int fps_id, int time_period)
 {
@@ -681,7 +680,6 @@ static int max77620_i2c_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct i2c_device_id max77620_id[] = {
 	{"max77620", MAX77620},
@@ -690,14 +688,13 @@ static const struct i2c_device_id max77620_id[] = {
 	{},
 };
 
-static const struct dev_pm_ops max77620_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(max77620_i2c_suspend, max77620_i2c_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
+				max77620_i2c_suspend, max77620_i2c_resume);
 
 static struct i2c_driver max77620_driver = {
 	.driver = {
 		.name = "max77620",
-		.pm = &max77620_pm_ops,
+		.pm = pm_sleep_ptr(&max77620_pm_ops),
 	},
 	.probe = max77620_probe,
 	.id_table = max77620_id,
-- 
2.35.1


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

* [PATCH 19/28] mfd: t7l66xb: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (17 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 18/28] mfd: max77620: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 20/28] mfd: arizona: " Paul Cercueil
                   ` (8 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new pm_sleep_ptr() macro to handle the .suspend/.resume
callbacks.

This macro allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/t7l66xb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 5369c67e3280..74d26dce2003 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -257,7 +257,6 @@ static void t7l66xb_detach_irq(struct platform_device *dev)
 
 /*--------------------------------------------------------------------------*/
 
-#ifdef CONFIG_PM
 static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
@@ -288,10 +287,6 @@ static int t7l66xb_resume(struct platform_device *dev)
 
 	return 0;
 }
-#else
-#define t7l66xb_suspend NULL
-#define t7l66xb_resume	NULL
-#endif
 
 /*--------------------------------------------------------------------------*/
 
@@ -420,8 +415,8 @@ static struct platform_driver t7l66xb_platform_driver = {
 	.driver = {
 		.name	= "t7l66xb",
 	},
-	.suspend	= t7l66xb_suspend,
-	.resume		= t7l66xb_resume,
+	.suspend	= pm_sleep_ptr(t7l66xb_suspend),
+	.resume		= pm_sleep_ptr(t7l66xb_resume),
 	.probe		= t7l66xb_probe,
 	.remove		= t7l66xb_remove,
 };
-- 
2.35.1


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

* [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (18 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 19/28] mfd: t7l66xb: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 17:33   ` kernel test robot
  2022-08-08  9:53   ` Richard Fitzgerald
  2022-08-07 14:52 ` [PATCH 21/28] mfd: max14577: " Paul Cercueil
                   ` (7 subsequent siblings)
  27 siblings, 2 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil, patches

Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
suspend/resume functions (and related code) outside #ifdef guards.

If CONFIG_PM is not set, the arizona_pm_ops will be defined as
"static __maybe_unused", and the structure plus all the callbacks will
be automatically dropped by the compiler.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: patches@opensource.cirrus.com
---
 drivers/mfd/arizona-core.c | 21 +++++++++++----------
 drivers/mfd/arizona-i2c.c  |  2 +-
 drivers/mfd/arizona-spi.c  |  2 +-
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index cbf1dd90b70d..c1acc9521f83 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -480,7 +480,6 @@ static int wm5102_clear_write_sequencer(struct arizona *arizona)
 	return 0;
 }
 
-#ifdef CONFIG_PM
 static int arizona_isolate_dcvdd(struct arizona *arizona)
 {
 	int ret;
@@ -742,9 +741,7 @@ static int arizona_runtime_suspend(struct device *dev)
 
 	return 0;
 }
-#endif
 
-#ifdef CONFIG_PM_SLEEP
 static int arizona_suspend(struct device *dev)
 {
 	struct arizona *arizona = dev_get_drvdata(dev);
@@ -784,17 +781,21 @@ static int arizona_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
+#ifndef CONFIG_PM
+static __maybe_unused
+#endif
 const struct dev_pm_ops arizona_pm_ops = {
-	SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
-			   arizona_runtime_resume,
-			   NULL)
-	SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
-				      arizona_resume_noirq)
+	RUNTIME_PM_OPS(arizona_runtime_suspend,
+		       arizona_runtime_resume,
+		       NULL)
+	SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
+				  arizona_resume_noirq)
 };
+#ifdef CONFIG_PM
 EXPORT_SYMBOL_GPL(arizona_pm_ops);
+#endif
 
 #ifdef CONFIG_OF
 static int arizona_of_get_core_pdata(struct arizona *arizona)
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index 6d83e6b9a692..8799d9183bee 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -119,7 +119,7 @@ static const struct of_device_id arizona_i2c_of_match[] = {
 static struct i2c_driver arizona_i2c_driver = {
 	.driver = {
 		.name	= "arizona",
-		.pm	= &arizona_pm_ops,
+		.pm	= pm_ptr(&arizona_pm_ops),
 		.of_match_table	= of_match_ptr(arizona_i2c_of_match),
 	},
 	.probe		= arizona_i2c_probe,
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index 941b0267d09d..da05b966d48c 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -282,7 +282,7 @@ static const struct of_device_id arizona_spi_of_match[] = {
 static struct spi_driver arizona_spi_driver = {
 	.driver = {
 		.name	= "arizona",
-		.pm	= &arizona_pm_ops,
+		.pm	= pm_ptr(&arizona_pm_ops),
 		.of_match_table	= of_match_ptr(arizona_spi_of_match),
 		.acpi_match_table = ACPI_PTR(arizona_acpi_match),
 	},
-- 
2.35.1


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

* [PATCH 21/28] mfd: max14577: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (19 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 20/28] mfd: arizona: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-08  9:11   ` Krzysztof Kozlowski
  2022-08-08 10:06   ` Krzysztof Kozlowski
  2022-08-07 14:52 ` [PATCH 22/28] mfd: max77686: " Paul Cercueil
                   ` (6 subsequent siblings)
  27 siblings, 2 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Chanwoo Choi, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/mfd/max14577.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index 6c487fa14e9c..9de29a8070c7 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -482,7 +482,6 @@ static const struct i2c_device_id max14577_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
 
-#ifdef CONFIG_PM_SLEEP
 static int max14577_suspend(struct device *dev)
 {
 	struct i2c_client *i2c = to_i2c_client(dev);
@@ -515,14 +514,13 @@ static int max14577_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume);
 
 static struct i2c_driver max14577_i2c_driver = {
 	.driver = {
 		.name = "max14577",
-		.pm = &max14577_pm,
+		.pm = pm_sleep_ptr(&max14577_pm),
 		.of_match_table = max14577_dt_match,
 	},
 	.probe = max14577_i2c_probe,
-- 
2.35.1


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

* [PATCH 22/28] mfd: max77686: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (20 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 21/28] mfd: max14577: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-08  9:11   ` Krzysztof Kozlowski
  2022-08-08 10:06   ` Krzysztof Kozlowski
  2022-08-07 14:52 ` [PATCH 23/28] mfd: motorola-cpcap: " Paul Cercueil
                   ` (5 subsequent siblings)
  27 siblings, 2 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Chanwoo Choi, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/mfd/max77686.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index 2ac64277fb84..f8e863f3fc95 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -226,7 +226,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max77686_suspend(struct device *dev)
 {
 	struct i2c_client *i2c = to_i2c_client(dev);
@@ -261,14 +260,13 @@ static int max77686_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume);
 
 static struct i2c_driver max77686_i2c_driver = {
 	.driver = {
 		   .name = "max77686",
-		   .pm = &max77686_pm,
+		   .pm = pm_sleep_ptr(&max77686_pm),
 		   .of_match_table = max77686_pmic_dt_match,
 	},
 	.probe_new = max77686_i2c_probe,
-- 
2.35.1


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

* [PATCH 23/28] mfd: motorola-cpcap: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (21 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 22/28] mfd: max77686: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 24/28] mfd: sprd-sc27xx: " Paul Cercueil
                   ` (4 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/motorola-cpcap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
index 265464b5d7cc..ae8930eff72d 100644
--- a/drivers/mfd/motorola-cpcap.c
+++ b/drivers/mfd/motorola-cpcap.c
@@ -221,7 +221,6 @@ static const struct regmap_config cpcap_regmap_config = {
 	.val_format_endian = REGMAP_ENDIAN_LITTLE,
 };
 
-#ifdef CONFIG_PM_SLEEP
 static int cpcap_suspend(struct device *dev)
 {
 	struct spi_device *spi = to_spi_device(dev);
@@ -239,9 +238,8 @@ static int cpcap_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
 
 static const struct mfd_cell cpcap_mfd_devices[] = {
 	{
@@ -346,7 +344,7 @@ static struct spi_driver cpcap_driver = {
 	.driver = {
 		.name = "cpcap-core",
 		.of_match_table = cpcap_of_match,
-		.pm = &cpcap_pm,
+		.pm = pm_sleep_ptr(&cpcap_pm),
 	},
 	.probe = cpcap_probe,
 	.id_table = cpcap_spi_ids,
-- 
2.35.1


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

* [PATCH 24/28] mfd: sprd-sc27xx: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (22 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 23/28] mfd: motorola-cpcap: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52   ` Paul Cercueil
                   ` (3 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Orson Zhai, Baolin Wang, Chunyan Zhang

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
---
 drivers/mfd/sprd-sc27xx-spi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/sprd-sc27xx-spi.c b/drivers/mfd/sprd-sc27xx-spi.c
index d05a47c5187f..ea68d73e5d1c 100644
--- a/drivers/mfd/sprd-sc27xx-spi.c
+++ b/drivers/mfd/sprd-sc27xx-spi.c
@@ -215,7 +215,6 @@ static int sprd_pmic_probe(struct spi_device *spi)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sprd_pmic_suspend(struct device *dev)
 {
 	struct sprd_pmic *ddata = dev_get_drvdata(dev);
@@ -235,9 +234,9 @@ static int sprd_pmic_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops,
+				sprd_pmic_suspend, sprd_pmic_resume);
 
 static const struct of_device_id sprd_pmic_match[] = {
 	{ .compatible = "sprd,sc2730", .data = &sc2730_data },
@@ -257,7 +256,7 @@ static struct spi_driver sprd_pmic_driver = {
 	.driver = {
 		.name = "sc27xx-pmic",
 		.of_match_table = sprd_pmic_match,
-		.pm = &sprd_pmic_pm_ops,
+		.pm = pm_sleep_ptr(&sprd_pmic_pm_ops),
 	},
 	.probe = sprd_pmic_probe,
 	.id_table = sprd_pmic_spi_ids,
-- 
2.35.1


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

* [PATCH 25/28] mfd: stmfx: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
@ 2022-08-07 14:52   ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 02/28] mfd: aat2870: " Paul Cercueil
                     ` (26 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Maxime Coquelin, Alexandre Torgue,
	linux-stm32, linux-arm-kernel

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/mfd/stmfx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 122f96094410..94af27346669 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -476,7 +476,6 @@ static int stmfx_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int stmfx_suspend(struct device *dev)
 {
 	struct stmfx *stmfx = dev_get_drvdata(dev);
@@ -542,9 +541,8 @@ static int stmfx_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
 
 static const struct of_device_id stmfx_of_match[] = {
 	{ .compatible = "st,stmfx-0300", },
@@ -556,7 +554,7 @@ static struct i2c_driver stmfx_driver = {
 	.driver = {
 		.name = "stmfx-core",
 		.of_match_table = stmfx_of_match,
-		.pm = &stmfx_dev_pm_ops,
+		.pm = pm_sleep_ptr(&stmfx_dev_pm_ops),
 	},
 	.probe = stmfx_probe,
 	.remove = stmfx_remove,
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 25/28] mfd: stmfx: Remove #ifdef guards for PM related functions
@ 2022-08-07 14:52   ` Paul Cercueil
  0 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Maxime Coquelin, Alexandre Torgue,
	linux-stm32, linux-arm-kernel

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/mfd/stmfx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 122f96094410..94af27346669 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -476,7 +476,6 @@ static int stmfx_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int stmfx_suspend(struct device *dev)
 {
 	struct stmfx *stmfx = dev_get_drvdata(dev);
@@ -542,9 +541,8 @@ static int stmfx_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
 
 static const struct of_device_id stmfx_of_match[] = {
 	{ .compatible = "st,stmfx-0300", },
@@ -556,7 +554,7 @@ static struct i2c_driver stmfx_driver = {
 	.driver = {
 		.name = "stmfx-core",
 		.of_match_table = stmfx_of_match,
-		.pm = &stmfx_dev_pm_ops,
+		.pm = pm_sleep_ptr(&stmfx_dev_pm_ops),
 	},
 	.probe = stmfx_probe,
 	.remove = stmfx_remove,
-- 
2.35.1


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

* [PATCH 26/28] mfd: stmpe: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
@ 2022-08-07 14:52   ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 02/28] mfd: aat2870: " Paul Cercueil
                     ` (26 subsequent siblings)
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Maxime Coquelin, Alexandre Torgue,
	linux-stm32, linux-arm-kernel

Use the new EXPORT_GPL_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/mfd/stmpe-i2c.c | 4 +---
 drivers/mfd/stmpe-spi.c | 4 +---
 drivers/mfd/stmpe.c     | 8 ++------
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index d3eedf3d607e..bf094cc9f9de 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -116,9 +116,7 @@ MODULE_DEVICE_TABLE(i2c, stmpe_i2c_id);
 static struct i2c_driver stmpe_i2c_driver = {
 	.driver = {
 		.name = "stmpe-i2c",
-#ifdef CONFIG_PM
-		.pm = &stmpe_dev_pm_ops,
-#endif
+		.pm = pm_sleep_ptr(&stmpe_dev_pm_ops),
 		.of_match_table = stmpe_of_match,
 	},
 	.probe		= stmpe_i2c_probe,
diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c
index ad8055a0e286..e9cbf33502b3 100644
--- a/drivers/mfd/stmpe-spi.c
+++ b/drivers/mfd/stmpe-spi.c
@@ -135,9 +135,7 @@ static struct spi_driver stmpe_spi_driver = {
 	.driver = {
 		.name	= "stmpe-spi",
 		.of_match_table = of_match_ptr(stmpe_spi_of_match),
-#ifdef CONFIG_PM
-		.pm	= &stmpe_dev_pm_ops,
-#endif
+		.pm	= pm_sleep_ptr(&stmpe_dev_pm_ops),
 	},
 	.probe		= stmpe_spi_probe,
 	.remove		= stmpe_spi_remove,
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index aeb9ea55f97d..a88cc1103589 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1508,7 +1508,6 @@ void stmpe_remove(struct stmpe *stmpe)
 	mfd_remove_devices(stmpe->dev);
 }
 
-#ifdef CONFIG_PM
 static int stmpe_suspend(struct device *dev)
 {
 	struct stmpe *stmpe = dev_get_drvdata(dev);
@@ -1529,8 +1528,5 @@ static int stmpe_resume(struct device *dev)
 	return 0;
 }
 
-const struct dev_pm_ops stmpe_dev_pm_ops = {
-	.suspend	= stmpe_suspend,
-	.resume		= stmpe_resume,
-};
-#endif
+const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,
+				   stmpe_suspend, stmpe_resume);
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 26/28] mfd: stmpe: Remove #ifdef guards for PM related functions
@ 2022-08-07 14:52   ` Paul Cercueil
  0 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Cercueil, Maxime Coquelin, Alexandre Torgue,
	linux-stm32, linux-arm-kernel

Use the new EXPORT_GPL_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/mfd/stmpe-i2c.c | 4 +---
 drivers/mfd/stmpe-spi.c | 4 +---
 drivers/mfd/stmpe.c     | 8 ++------
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index d3eedf3d607e..bf094cc9f9de 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -116,9 +116,7 @@ MODULE_DEVICE_TABLE(i2c, stmpe_i2c_id);
 static struct i2c_driver stmpe_i2c_driver = {
 	.driver = {
 		.name = "stmpe-i2c",
-#ifdef CONFIG_PM
-		.pm = &stmpe_dev_pm_ops,
-#endif
+		.pm = pm_sleep_ptr(&stmpe_dev_pm_ops),
 		.of_match_table = stmpe_of_match,
 	},
 	.probe		= stmpe_i2c_probe,
diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c
index ad8055a0e286..e9cbf33502b3 100644
--- a/drivers/mfd/stmpe-spi.c
+++ b/drivers/mfd/stmpe-spi.c
@@ -135,9 +135,7 @@ static struct spi_driver stmpe_spi_driver = {
 	.driver = {
 		.name	= "stmpe-spi",
 		.of_match_table = of_match_ptr(stmpe_spi_of_match),
-#ifdef CONFIG_PM
-		.pm	= &stmpe_dev_pm_ops,
-#endif
+		.pm	= pm_sleep_ptr(&stmpe_dev_pm_ops),
 	},
 	.probe		= stmpe_spi_probe,
 	.remove		= stmpe_spi_remove,
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index aeb9ea55f97d..a88cc1103589 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1508,7 +1508,6 @@ void stmpe_remove(struct stmpe *stmpe)
 	mfd_remove_devices(stmpe->dev);
 }
 
-#ifdef CONFIG_PM
 static int stmpe_suspend(struct device *dev)
 {
 	struct stmpe *stmpe = dev_get_drvdata(dev);
@@ -1529,8 +1528,5 @@ static int stmpe_resume(struct device *dev)
 	return 0;
 }
 
-const struct dev_pm_ops stmpe_dev_pm_ops = {
-	.suspend	= stmpe_suspend,
-	.resume		= stmpe_resume,
-};
-#endif
+const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,
+				   stmpe_suspend, stmpe_resume);
-- 
2.35.1


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

* [PATCH 27/28] mfd: tc3589x: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (25 preceding siblings ...)
  2022-08-07 14:52   ` Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  2022-08-07 14:52 ` [PATCH 28/28] mfd: tc6393xb: " Paul Cercueil
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/tc3589x.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 13583cdb93b6..ab7e0f6f5489 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -438,7 +438,6 @@ static int tc3589x_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tc3589x_suspend(struct device *dev)
 {
 	struct tc3589x *tc3589x = dev_get_drvdata(dev);
@@ -466,9 +465,9 @@ static int tc3589x_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(tc3589x_dev_pm_ops, tc3589x_suspend, tc3589x_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_dev_pm_ops,
+				tc3589x_suspend, tc3589x_resume);
 
 static const struct i2c_device_id tc3589x_id[] = {
 	{ "tc35890", TC3589X_TC35890 },
@@ -485,7 +484,7 @@ MODULE_DEVICE_TABLE(i2c, tc3589x_id);
 static struct i2c_driver tc3589x_driver = {
 	.driver = {
 		.name	= "tc3589x",
-		.pm	= &tc3589x_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&tc3589x_dev_pm_ops),
 		.of_match_table = of_match_ptr(tc3589x_match),
 	},
 	.probe		= tc3589x_probe,
-- 
2.35.1


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

* [PATCH 28/28] mfd: tc6393xb: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
                   ` (26 preceding siblings ...)
  2022-08-07 14:52 ` [PATCH 27/28] mfd: tc3589x: " Paul Cercueil
@ 2022-08-07 14:52 ` Paul Cercueil
  27 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 14:52 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Cercueil

Use the new pm_sleep_ptr() macro to handle the .suspend/.resume
callbacks.

This macro allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

The advantage is then that these functions are now always compiled
independently of any Kconfig option, and thanks to that bugs and
regressions are easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mfd/tc6393xb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 0be5731685b4..9e1ecd92902c 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -814,7 +814,6 @@ static int tc6393xb_remove(struct platform_device *dev)
 	return ret;
 }
 
-#ifdef CONFIG_PM
 static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
@@ -877,16 +876,12 @@ static int tc6393xb_resume(struct platform_device *dev)
 
 	return 0;
 }
-#else
-#define tc6393xb_suspend NULL
-#define tc6393xb_resume NULL
-#endif
 
 static struct platform_driver tc6393xb_driver = {
 	.probe = tc6393xb_probe,
 	.remove = tc6393xb_remove,
-	.suspend = tc6393xb_suspend,
-	.resume = tc6393xb_resume,
+	.suspend = pm_sleep_ptr(tc6393xb_suspend),
+	.resume = pm_sleep_ptr(tc6393xb_resume),
 
 	.driver = {
 		.name = "tc6393xb",
-- 
2.35.1


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

* Re: [PATCH 11/28] mfd: intel_soc_pmic: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 11/28] mfd: intel_soc_pmic: " Paul Cercueil
@ 2022-08-07 15:50   ` Andy Shevchenko
  2022-08-07 15:58     ` Paul Cercueil
  0 siblings, 1 reply; 63+ messages in thread
From: Andy Shevchenko @ 2022-08-07 15:50 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Lee Jones, Linux Kernel Mailing List, Andy Shevchenko

On Sun, Aug 7, 2022 at 4:53 PM Paul Cercueil <paul@crapouillou.net> wrote:
>
> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> to handle the .suspend/.resume callbacks.
>
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use #ifdef guards.
>
> The advantage is then that these functions are now always compiled

is that

> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.

...

>  drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +++----
>  drivers/mfd/intel_soc_pmic_core.c  | 8 +++-----

1. These are two different drivers, the patch needs to be split.
2. The Broxton Whiskey Cove should have a similar change. Which base
have you used for your patch? Please, rebase on top of for-mfd-next.
3. The PMIC core actually is Crystal Cove driver and I have a pending
series for that and I guess you know about it. Have you seen what have
been done there?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 11/28] mfd: intel_soc_pmic: Remove #ifdef guards for PM related functions
  2022-08-07 15:50   ` Andy Shevchenko
@ 2022-08-07 15:58     ` Paul Cercueil
  2022-08-08 11:56       ` Andy Shevchenko
  0 siblings, 1 reply; 63+ messages in thread
From: Paul Cercueil @ 2022-08-07 15:58 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Lee Jones, Linux Kernel Mailing List, Andy Shevchenko



Le dim., août 7 2022 at 17:50:32 +0200, Andy Shevchenko 
<andy.shevchenko@gmail.com> a écrit :
> On Sun, Aug 7, 2022 at 4:53 PM Paul Cercueil <paul@crapouillou.net> 
> wrote:
>> 
>>  Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
>>  to handle the .suspend/.resume callbacks.
>> 
>>  These macros allow the suspend and resume functions to be 
>> automatically
>>  dropped by the compiler when CONFIG_SUSPEND is disabled, without 
>> having
>>  to use #ifdef guards.
>> 
>>  The advantage is then that these functions are now always compiled
> 
> is that

I think that what I wrote is proper English.

> 
>>  independently of any Kconfig option, and thanks to that bugs and
>>  regressions are easier to catch.
> 
> ...
> 
>>   drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +++----
>>   drivers/mfd/intel_soc_pmic_core.c  | 8 +++-----
> 
> 1. These are two different drivers, the patch needs to be split.

Ok.

> 2. The Broxton Whiskey Cove should have a similar change. Which base
> have you used for your patch? Please, rebase on top of for-mfd-next.

That's based on v5.19.

> 3. The PMIC core actually is Crystal Cove driver and I have a pending
> series for that and I guess you know about it. Have you seen what have
> been done there?

No, I didn't know. I guess Lee can skip my patch 11/28 then.

Cheers,
-Paul



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

* Re: [PATCH 25/28] mfd: stmfx: Remove #ifdef guards for PM related functions
  2022-08-07 14:52   ` Paul Cercueil
@ 2022-08-07 16:00     ` kernel test robot
  -1 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 16:00 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: openrisc-randconfig-r015-20220807 (https://download.01.org/0day-ci/archive/20220807/202208072317.F5f2MGx5-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/5a39bd52d549e3f3be743fb336dd710eac75055d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout 5a39bd52d549e3f3be743fb336dd710eac75055d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/mfd/stmfx.c: In function 'stmfx_suspend':
>> drivers/mfd/stmfx.c:485:37: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     485 |                               &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                     ^~
   drivers/mfd/stmfx.c:485:64: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     485 |                               &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                                                ^~
>> drivers/mfd/stmfx.c:490:37: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     490 |                               &stmfx->bkp_irqoutpin,
         |                                     ^~
   drivers/mfd/stmfx.c:491:43: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     491 |                               sizeof(stmfx->bkp_irqoutpin));
         |                                           ^~
   drivers/mfd/stmfx.c: In function 'stmfx_resume':
   drivers/mfd/stmfx.c:525:38: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     525 |                                &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                      ^~
   drivers/mfd/stmfx.c:525:65: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     525 |                                &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                                                 ^~
   drivers/mfd/stmfx.c:530:38: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     530 |                                &stmfx->bkp_irqoutpin,
         |                                      ^~
   drivers/mfd/stmfx.c:531:44: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     531 |                                sizeof(stmfx->bkp_irqoutpin));
         |                                            ^~


vim +485 drivers/mfd/stmfx.c

06252ade915665 Amelie Delaunay 2019-05-09  478  
06252ade915665 Amelie Delaunay 2019-05-09  479  static int stmfx_suspend(struct device *dev)
06252ade915665 Amelie Delaunay 2019-05-09  480  {
06252ade915665 Amelie Delaunay 2019-05-09  481  	struct stmfx *stmfx = dev_get_drvdata(dev);
06252ade915665 Amelie Delaunay 2019-05-09  482  	int ret;
06252ade915665 Amelie Delaunay 2019-05-09  483  
06252ade915665 Amelie Delaunay 2019-05-09  484  	ret = regmap_raw_read(stmfx->map, STMFX_REG_SYS_CTRL,
06252ade915665 Amelie Delaunay 2019-05-09 @485  			      &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
06252ade915665 Amelie Delaunay 2019-05-09  486  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  487  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  488  
06252ade915665 Amelie Delaunay 2019-05-09  489  	ret = regmap_raw_read(stmfx->map, STMFX_REG_IRQ_OUT_PIN,
06252ade915665 Amelie Delaunay 2019-05-09 @490  			      &stmfx->bkp_irqoutpin,
06252ade915665 Amelie Delaunay 2019-05-09  491  			      sizeof(stmfx->bkp_irqoutpin));
06252ade915665 Amelie Delaunay 2019-05-09  492  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  493  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  494  
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  495  	disable_irq(stmfx->irq);
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  496  
06252ade915665 Amelie Delaunay 2019-05-09  497  	if (stmfx->vdd)
06252ade915665 Amelie Delaunay 2019-05-09  498  		return regulator_disable(stmfx->vdd);
06252ade915665 Amelie Delaunay 2019-05-09  499  
06252ade915665 Amelie Delaunay 2019-05-09  500  	return 0;
06252ade915665 Amelie Delaunay 2019-05-09  501  }
06252ade915665 Amelie Delaunay 2019-05-09  502  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: [PATCH 25/28] mfd: stmfx: Remove #ifdef guards for PM related functions
@ 2022-08-07 16:00     ` kernel test robot
  0 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 16:00 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: openrisc-randconfig-r015-20220807 (https://download.01.org/0day-ci/archive/20220807/202208072317.F5f2MGx5-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/5a39bd52d549e3f3be743fb336dd710eac75055d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout 5a39bd52d549e3f3be743fb336dd710eac75055d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/mfd/stmfx.c: In function 'stmfx_suspend':
>> drivers/mfd/stmfx.c:485:37: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     485 |                               &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                     ^~
   drivers/mfd/stmfx.c:485:64: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     485 |                               &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                                                ^~
>> drivers/mfd/stmfx.c:490:37: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     490 |                               &stmfx->bkp_irqoutpin,
         |                                     ^~
   drivers/mfd/stmfx.c:491:43: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     491 |                               sizeof(stmfx->bkp_irqoutpin));
         |                                           ^~
   drivers/mfd/stmfx.c: In function 'stmfx_resume':
   drivers/mfd/stmfx.c:525:38: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     525 |                                &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                      ^~
   drivers/mfd/stmfx.c:525:65: error: 'struct stmfx' has no member named 'bkp_sysctrl'
     525 |                                &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
         |                                                                 ^~
   drivers/mfd/stmfx.c:530:38: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     530 |                                &stmfx->bkp_irqoutpin,
         |                                      ^~
   drivers/mfd/stmfx.c:531:44: error: 'struct stmfx' has no member named 'bkp_irqoutpin'
     531 |                                sizeof(stmfx->bkp_irqoutpin));
         |                                            ^~


vim +485 drivers/mfd/stmfx.c

06252ade915665 Amelie Delaunay 2019-05-09  478  
06252ade915665 Amelie Delaunay 2019-05-09  479  static int stmfx_suspend(struct device *dev)
06252ade915665 Amelie Delaunay 2019-05-09  480  {
06252ade915665 Amelie Delaunay 2019-05-09  481  	struct stmfx *stmfx = dev_get_drvdata(dev);
06252ade915665 Amelie Delaunay 2019-05-09  482  	int ret;
06252ade915665 Amelie Delaunay 2019-05-09  483  
06252ade915665 Amelie Delaunay 2019-05-09  484  	ret = regmap_raw_read(stmfx->map, STMFX_REG_SYS_CTRL,
06252ade915665 Amelie Delaunay 2019-05-09 @485  			      &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
06252ade915665 Amelie Delaunay 2019-05-09  486  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  487  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  488  
06252ade915665 Amelie Delaunay 2019-05-09  489  	ret = regmap_raw_read(stmfx->map, STMFX_REG_IRQ_OUT_PIN,
06252ade915665 Amelie Delaunay 2019-05-09 @490  			      &stmfx->bkp_irqoutpin,
06252ade915665 Amelie Delaunay 2019-05-09  491  			      sizeof(stmfx->bkp_irqoutpin));
06252ade915665 Amelie Delaunay 2019-05-09  492  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  493  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  494  
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  495  	disable_irq(stmfx->irq);
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  496  
06252ade915665 Amelie Delaunay 2019-05-09  497  	if (stmfx->vdd)
06252ade915665 Amelie Delaunay 2019-05-09  498  		return regulator_disable(stmfx->vdd);
06252ade915665 Amelie Delaunay 2019-05-09  499  
06252ade915665 Amelie Delaunay 2019-05-09  500  	return 0;
06252ade915665 Amelie Delaunay 2019-05-09  501  }
06252ade915665 Amelie Delaunay 2019-05-09  502  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 26/28] mfd: stmpe: Remove #ifdef guards for PM related functions
  2022-08-07 14:52   ` Paul Cercueil
@ 2022-08-07 16:42     ` kernel test robot
  -1 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 16:42 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: openrisc-randconfig-r015-20220807 (https://download.01.org/0day-ci/archive/20220808/202208080002.oJGJBzP5-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/e94df3ff809e588320625b95a2ef6485965ddc02
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout e94df3ff809e588320625b95a2ef6485965ddc02
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/mfd/stmpe.c:1531:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
    1531 | const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,
         | ^~~~~


vim +/static +1531 drivers/mfd/stmpe.c

  1530	
> 1531	const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 26/28] mfd: stmpe: Remove #ifdef guards for PM related functions
@ 2022-08-07 16:42     ` kernel test robot
  0 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 16:42 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: openrisc-randconfig-r015-20220807 (https://download.01.org/0day-ci/archive/20220808/202208080002.oJGJBzP5-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/e94df3ff809e588320625b95a2ef6485965ddc02
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout e94df3ff809e588320625b95a2ef6485965ddc02
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/mfd/stmpe.c:1531:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
    1531 | const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,
         | ^~~~~


vim +/static +1531 drivers/mfd/stmpe.c

  1530	
> 1531	const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: [PATCH 26/28] mfd: stmpe: Remove #ifdef guards for PM related functions
  2022-08-07 14:52   ` Paul Cercueil
@ 2022-08-07 17:13     ` kernel test robot
  -1 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 17:13 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: llvm, kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220808/202208080127.BXcJl3Wk-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/e94df3ff809e588320625b95a2ef6485965ddc02
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout e94df3ff809e588320625b95a2ef6485965ddc02
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/mfd/stmpe.c:1531:7: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
   const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,
         ^
   include/linux/pm.h:404:2: note: expanded from macro 'EXPORT_GPL_SIMPLE_DEV_PM_OPS'
           _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "_gpl", "")
           ^
   include/linux/pm.h:380:2: note: expanded from macro '_EXPORT_DEV_PM_OPS'
           _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, runtime_suspend_fn, \
           ^
   include/linux/pm.h:371:55: note: expanded from macro '_DEFINE_DEV_PM_OPS'
                              runtime_suspend_fn, runtime_resume_fn, idle_fn) \
                                                                              ^
   1 warning generated.


vim +/const +1531 drivers/mfd/stmpe.c

  1530	
> 1531	const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: [PATCH 26/28] mfd: stmpe: Remove #ifdef guards for PM related functions
@ 2022-08-07 17:13     ` kernel test robot
  0 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 17:13 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: llvm, kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220808/202208080127.BXcJl3Wk-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/e94df3ff809e588320625b95a2ef6485965ddc02
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout e94df3ff809e588320625b95a2ef6485965ddc02
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/mfd/stmpe.c:1531:7: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
   const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,
         ^
   include/linux/pm.h:404:2: note: expanded from macro 'EXPORT_GPL_SIMPLE_DEV_PM_OPS'
           _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "_gpl", "")
           ^
   include/linux/pm.h:380:2: note: expanded from macro '_EXPORT_DEV_PM_OPS'
           _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, runtime_suspend_fn, \
           ^
   include/linux/pm.h:371:55: note: expanded from macro '_DEFINE_DEV_PM_OPS'
                              runtime_suspend_fn, runtime_resume_fn, idle_fn) \
                                                                              ^
   1 warning generated.


vim +/const +1531 drivers/mfd/stmpe.c

  1530	
> 1531	const EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 20/28] mfd: arizona: " Paul Cercueil
@ 2022-08-07 17:33   ` kernel test robot
  2022-08-08  9:53   ` Richard Fitzgerald
  1 sibling, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 17:33 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: llvm, kbuild-all, linux-kernel, Paul Cercueil, patches

Hi Paul,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: hexagon-randconfig-r013-20220807 (https://download.01.org/0day-ci/archive/20220808/202208080141.UIoxRyzL-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/03342844cafff973ffa39ce471f64a76c4d87b06
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout 03342844cafff973ffa39ce471f64a76c4d87b06
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/mfd/arizona-core.c:788:25: error: static declaration of 'arizona_pm_ops' follows non-static declaration
   const struct dev_pm_ops arizona_pm_ops = {
                           ^
   drivers/mfd/arizona.h:29:32: note: previous declaration is here
   extern const struct dev_pm_ops arizona_pm_ops;
                                  ^
   1 error generated.


vim +/arizona_pm_ops +788 drivers/mfd/arizona-core.c

dc781d0e10fca2 Mark Brown     2013-01-27  784  
03342844cafff9 Paul Cercueil  2022-08-07  785  #ifndef CONFIG_PM
03342844cafff9 Paul Cercueil  2022-08-07  786  static __maybe_unused
03342844cafff9 Paul Cercueil  2022-08-07  787  #endif
3cc72986947501 Mark Brown     2012-06-19 @788  const struct dev_pm_ops arizona_pm_ops = {
03342844cafff9 Paul Cercueil  2022-08-07  789  	RUNTIME_PM_OPS(arizona_runtime_suspend,
3cc72986947501 Mark Brown     2012-06-19  790  		       arizona_runtime_resume,
3cc72986947501 Mark Brown     2012-06-19  791  		       NULL)
03342844cafff9 Paul Cercueil  2022-08-07  792  	SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
03342844cafff9 Paul Cercueil  2022-08-07  793  	NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
3612b27cfb4a07 Charles Keepax 2016-08-30  794  				  arizona_resume_noirq)
3cc72986947501 Mark Brown     2012-06-19  795  };
03342844cafff9 Paul Cercueil  2022-08-07  796  #ifdef CONFIG_PM
3cc72986947501 Mark Brown     2012-06-19  797  EXPORT_SYMBOL_GPL(arizona_pm_ops);
03342844cafff9 Paul Cercueil  2022-08-07  798  #endif
3cc72986947501 Mark Brown     2012-06-19  799  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: [PATCH 25/28] mfd: stmfx: Remove #ifdef guards for PM related functions
  2022-08-07 14:52   ` Paul Cercueil
@ 2022-08-07 18:15     ` kernel test robot
  -1 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 18:15 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: llvm, kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: hexagon-randconfig-r013-20220807 (https://download.01.org/0day-ci/archive/20220808/202208080225.Hm01SP8r-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/5a39bd52d549e3f3be743fb336dd710eac75055d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout 5a39bd52d549e3f3be743fb336dd710eac75055d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/mfd/stmfx.c:485:18: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                 &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                  ~~~~~  ^
   drivers/mfd/stmfx.c:485:45: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                 &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                                             ~~~~~  ^
>> drivers/mfd/stmfx.c:490:18: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                 &stmfx->bkp_irqoutpin,
                                  ~~~~~  ^
   drivers/mfd/stmfx.c:491:24: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                 sizeof(stmfx->bkp_irqoutpin));
                                        ~~~~~  ^
   drivers/mfd/stmfx.c:525:19: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                  &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                   ~~~~~  ^
   drivers/mfd/stmfx.c:525:46: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                  &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                                              ~~~~~  ^
   drivers/mfd/stmfx.c:530:19: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                  &stmfx->bkp_irqoutpin,
                                   ~~~~~  ^
   drivers/mfd/stmfx.c:531:25: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                  sizeof(stmfx->bkp_irqoutpin));
                                         ~~~~~  ^
   8 errors generated.


vim +485 drivers/mfd/stmfx.c

06252ade915665 Amelie Delaunay 2019-05-09  478  
06252ade915665 Amelie Delaunay 2019-05-09  479  static int stmfx_suspend(struct device *dev)
06252ade915665 Amelie Delaunay 2019-05-09  480  {
06252ade915665 Amelie Delaunay 2019-05-09  481  	struct stmfx *stmfx = dev_get_drvdata(dev);
06252ade915665 Amelie Delaunay 2019-05-09  482  	int ret;
06252ade915665 Amelie Delaunay 2019-05-09  483  
06252ade915665 Amelie Delaunay 2019-05-09  484  	ret = regmap_raw_read(stmfx->map, STMFX_REG_SYS_CTRL,
06252ade915665 Amelie Delaunay 2019-05-09 @485  			      &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
06252ade915665 Amelie Delaunay 2019-05-09  486  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  487  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  488  
06252ade915665 Amelie Delaunay 2019-05-09  489  	ret = regmap_raw_read(stmfx->map, STMFX_REG_IRQ_OUT_PIN,
06252ade915665 Amelie Delaunay 2019-05-09 @490  			      &stmfx->bkp_irqoutpin,
06252ade915665 Amelie Delaunay 2019-05-09  491  			      sizeof(stmfx->bkp_irqoutpin));
06252ade915665 Amelie Delaunay 2019-05-09  492  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  493  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  494  
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  495  	disable_irq(stmfx->irq);
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  496  
06252ade915665 Amelie Delaunay 2019-05-09  497  	if (stmfx->vdd)
06252ade915665 Amelie Delaunay 2019-05-09  498  		return regulator_disable(stmfx->vdd);
06252ade915665 Amelie Delaunay 2019-05-09  499  
06252ade915665 Amelie Delaunay 2019-05-09  500  	return 0;
06252ade915665 Amelie Delaunay 2019-05-09  501  }
06252ade915665 Amelie Delaunay 2019-05-09  502  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: [PATCH 25/28] mfd: stmfx: Remove #ifdef guards for PM related functions
@ 2022-08-07 18:15     ` kernel test robot
  0 siblings, 0 replies; 63+ messages in thread
From: kernel test robot @ 2022-08-07 18:15 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: llvm, kbuild-all, linux-kernel, Paul Cercueil, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel

Hi Paul,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.19]
[cannot apply to lee-mfd/for-mfd-next linus/master next-20220805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
base:    3d7cb6b04c3f3115719235cc6866b10326de34cd
config: hexagon-randconfig-r013-20220807 (https://download.01.org/0day-ci/archive/20220808/202208080225.Hm01SP8r-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/5a39bd52d549e3f3be743fb336dd710eac75055d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Cercueil/mfd-Remove-ifdef-guards-for-PM-functions/20220807-225947
        git checkout 5a39bd52d549e3f3be743fb336dd710eac75055d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/mfd/stmfx.c:485:18: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                 &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                  ~~~~~  ^
   drivers/mfd/stmfx.c:485:45: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                 &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                                             ~~~~~  ^
>> drivers/mfd/stmfx.c:490:18: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                 &stmfx->bkp_irqoutpin,
                                  ~~~~~  ^
   drivers/mfd/stmfx.c:491:24: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                 sizeof(stmfx->bkp_irqoutpin));
                                        ~~~~~  ^
   drivers/mfd/stmfx.c:525:19: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                  &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                   ~~~~~  ^
   drivers/mfd/stmfx.c:525:46: error: no member named 'bkp_sysctrl' in 'struct stmfx'
                                  &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
                                                              ~~~~~  ^
   drivers/mfd/stmfx.c:530:19: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                  &stmfx->bkp_irqoutpin,
                                   ~~~~~  ^
   drivers/mfd/stmfx.c:531:25: error: no member named 'bkp_irqoutpin' in 'struct stmfx'
                                  sizeof(stmfx->bkp_irqoutpin));
                                         ~~~~~  ^
   8 errors generated.


vim +485 drivers/mfd/stmfx.c

06252ade915665 Amelie Delaunay 2019-05-09  478  
06252ade915665 Amelie Delaunay 2019-05-09  479  static int stmfx_suspend(struct device *dev)
06252ade915665 Amelie Delaunay 2019-05-09  480  {
06252ade915665 Amelie Delaunay 2019-05-09  481  	struct stmfx *stmfx = dev_get_drvdata(dev);
06252ade915665 Amelie Delaunay 2019-05-09  482  	int ret;
06252ade915665 Amelie Delaunay 2019-05-09  483  
06252ade915665 Amelie Delaunay 2019-05-09  484  	ret = regmap_raw_read(stmfx->map, STMFX_REG_SYS_CTRL,
06252ade915665 Amelie Delaunay 2019-05-09 @485  			      &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
06252ade915665 Amelie Delaunay 2019-05-09  486  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  487  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  488  
06252ade915665 Amelie Delaunay 2019-05-09  489  	ret = regmap_raw_read(stmfx->map, STMFX_REG_IRQ_OUT_PIN,
06252ade915665 Amelie Delaunay 2019-05-09 @490  			      &stmfx->bkp_irqoutpin,
06252ade915665 Amelie Delaunay 2019-05-09  491  			      sizeof(stmfx->bkp_irqoutpin));
06252ade915665 Amelie Delaunay 2019-05-09  492  	if (ret)
06252ade915665 Amelie Delaunay 2019-05-09  493  		return ret;
06252ade915665 Amelie Delaunay 2019-05-09  494  
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  495  	disable_irq(stmfx->irq);
97eda5dcc2cde5 Amelie Delaunay 2020-04-22  496  
06252ade915665 Amelie Delaunay 2019-05-09  497  	if (stmfx->vdd)
06252ade915665 Amelie Delaunay 2019-05-09  498  		return regulator_disable(stmfx->vdd);
06252ade915665 Amelie Delaunay 2019-05-09  499  
06252ade915665 Amelie Delaunay 2019-05-09  500  	return 0;
06252ade915665 Amelie Delaunay 2019-05-09  501  }
06252ade915665 Amelie Delaunay 2019-05-09  502  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH 03/28] mfd: adp5520: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 03/28] mfd: adp5520: " Paul Cercueil
@ 2022-08-08  7:46   ` Hennerich, Michael
  0 siblings, 0 replies; 63+ messages in thread
From: Hennerich, Michael @ 2022-08-08  7:46 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones; +Cc: linux-kernel



> -----Original Message-----
> From: Paul Cercueil <paul@crapouillou.net>
> Sent: Sonntag, 7. August 2022 16:52
> To: Lee Jones <lee.jones@linaro.org>
> Cc: linux-kernel@vger.kernel.org; Paul Cercueil <paul@crapouillou.net>;
> Hennerich, Michael <Michael.Hennerich@analog.com>
> Subject: [PATCH 03/28] mfd: adp5520: Remove #ifdef guards for PM related
> functions
> 
> 
> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> to handle the .suspend/.resume callbacks.
> 
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without
> having to use #ifdef guards.
> 
> The advantage is then that these functions are now always compiled
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: Michael Hennerich <michael.hennerich@analog.com>

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

> ---
>  drivers/mfd/adp5520.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c index
> 8db15f5a7179..882eddc32f8e 100644
> --- a/drivers/mfd/adp5520.c
> +++ b/drivers/mfd/adp5520.c
> @@ -305,7 +305,6 @@ static int adp5520_probe(struct i2c_client *client,
>  	return ret;
>  }
> 
> -#ifdef CONFIG_PM_SLEEP
>  static int adp5520_suspend(struct device *dev)  {
>  	struct i2c_client *client = to_i2c_client(dev); @@ -326,9 +325,8 @@
> static int adp5520_resume(struct device *dev)
>  	adp5520_write(chip->dev, ADP5520_MODE_STATUS, chip->mode);
>  	return 0;
>  }
> -#endif
> 
> -static SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend,
> adp5520_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend,
> +adp5520_resume);
> 
>  static const struct i2c_device_id adp5520_id[] = {
>  	{ "pmic-adp5520", ID_ADP5520 },
> @@ -339,7 +337,7 @@ static const struct i2c_device_id adp5520_id[] = {
> static struct i2c_driver adp5520_driver = {
>  	.driver = {
>  		.name			= "adp5520",
> -		.pm			= &adp5520_pm,
> +		.pm			= pm_sleep_ptr(&adp5520_pm),
>  		.suppress_bind_attrs	= true,
>  	},
>  	.probe		= adp5520_probe,
> --
> 2.35.1


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

* Re: [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 13/28] mfd: sec: " Paul Cercueil
@ 2022-08-08  9:11   ` Krzysztof Kozlowski
  2022-08-08  9:28     ` Paul Cercueil
  2022-08-09 15:33     ` Lee Jones
  0 siblings, 2 replies; 63+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-08  9:11 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz, linux-samsung-soc

On 07/08/2022 17:52, Paul Cercueil wrote:
> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> to handle the .suspend/.resume callbacks.
> 
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use #ifdef guards.
> 
> The advantage is then that these functions are now always compiled
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

The address does not work. Please don't add it to commit log.

> Cc: linux-samsung-soc@vger.kernel.org

This is also not really needed in commit log... it's just a mailing list...

I actually never understood why people want to add to commit log, so to
something which will last 10 years, Cc-ing other folks, instead of
adding such tags after '---'. Imagine 10 years from now:

1. What's the point to be cced on this patch after 10 years instead of
using maintainers file (the one in 10 years)? Why Cc-ing me in 10 years?
If I am a maintainer of this driver in that time, I will be C-ced based
on maintainers file. If I am not a maintainer in 10 years, why the heck
cc-ing me based on some 10-year old commit? Just because I was a
maintainer once, like 10 years ago?

2. Or why cc-ing such people when backporting to stable?

It's quite a lot of unnecessary emails which many of us won't actually
handle later...

I sincerely admit I was once also adding such Cc-tags. But that time my
employer was counting lines-of-patch (including commit log)... crazy, right?


> ---
>  drivers/mfd/sec-core.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index 1fb29c45f5cf..a467de2b2fea 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -455,7 +455,6 @@ static void sec_pmic_shutdown(struct i2c_client *i2c)
>  	regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0);
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int sec_pmic_suspend(struct device *dev)

Did you test W=1 with !CONFIG_PM_SLEEP? No warnings?


Best regards,
Krzysztof

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

* Re: [PATCH 21/28] mfd: max14577: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 21/28] mfd: max14577: " Paul Cercueil
@ 2022-08-08  9:11   ` Krzysztof Kozlowski
  2022-08-08 10:06   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 63+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-08  9:11 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: linux-kernel, Chanwoo Choi, Bartlomiej Zolnierkiewicz

On 07/08/2022 17:52, Paul Cercueil wrote:
> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> to handle the .suspend/.resume callbacks.
> 
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use #ifdef guards.
> 
> The advantage is then that these functions are now always compiled
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Drop the address. Does not work.


Best regards,
Krzysztof

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

* Re: [PATCH 22/28] mfd: max77686: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 22/28] mfd: max77686: " Paul Cercueil
@ 2022-08-08  9:11   ` Krzysztof Kozlowski
  2022-08-08 10:06   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 63+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-08  9:11 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: linux-kernel, Chanwoo Choi, Bartlomiej Zolnierkiewicz

On 07/08/2022 17:52, Paul Cercueil wrote:
> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> to handle the .suspend/.resume callbacks.
> 
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use #ifdef guards.
> 
> The advantage is then that these functions are now always compiled
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Drop the address. Does not work.

Although of course I wished address was fixed (about which we were all
pinging long time ago).

Best regards,
Krzysztof

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

* Re: [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-08  9:11   ` Krzysztof Kozlowski
@ 2022-08-08  9:28     ` Paul Cercueil
  2022-08-08 10:06       ` Krzysztof Kozlowski
  2022-08-09 15:33     ` Lee Jones
  1 sibling, 1 reply; 63+ messages in thread
From: Paul Cercueil @ 2022-08-08  9:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Lee Jones, linux-kernel, Bartlomiej Zolnierkiewicz, linux-samsung-soc

Hi Krzysztof,

Le lun., août 8 2022 at 12:11:02 +0300, Krzysztof Kozlowski 
<krzysztof.kozlowski@linaro.org> a écrit :
> On 07/08/2022 17:52, Paul Cercueil wrote:
>>  Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
>>  to handle the .suspend/.resume callbacks.
>> 
>>  These macros allow the suspend and resume functions to be 
>> automatically
>>  dropped by the compiler when CONFIG_SUSPEND is disabled, without 
>> having
>>  to use #ifdef guards.
>> 
>>  The advantage is then that these functions are now always compiled
>>  independently of any Kconfig option, and thanks to that bugs and
>>  regressions are easier to catch.
>> 
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>  Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> 
> The address does not work. Please don't add it to commit log.

That's what get-maintainers gave me, and I didn't get any error sending 
at that address. But I'll take your word.

>>  Cc: linux-samsung-soc@vger.kernel.org
> 
> This is also not really needed in commit log... it's just a mailing 
> list...
> 
> I actually never understood why people want to add to commit log, so 
> to
> something which will last 10 years, Cc-ing other folks, instead of
> adding such tags after '---'. Imagine 10 years from now:
> 
> 1. What's the point to be cced on this patch after 10 years instead of
> using maintainers file (the one in 10 years)? Why Cc-ing me in 10 
> years?
> If I am a maintainer of this driver in that time, I will be C-ced 
> based
> on maintainers file. If I am not a maintainer in 10 years, why the 
> heck
> cc-ing me based on some 10-year old commit? Just because I was a
> maintainer once, like 10 years ago?
> 
> 2. Or why cc-ing such people when backporting to stable?
> 
> It's quite a lot of unnecessary emails which many of us won't actually
> handle later...
> 
> I sincerely admit I was once also adding such Cc-tags. But that time 
> my
> employer was counting lines-of-patch (including commit log)... crazy, 
> right?

Yeah, well, I can add these tags after the '---' line. Nobody ever told 
me that I was doing it wrong, and I see Cc: tags quite often in commit 
messages, so I thought it was common practice.

>>  ---
>>   drivers/mfd/sec-core.c | 7 +++----
>>   1 file changed, 3 insertions(+), 4 deletions(-)
>> 
>>  diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
>>  index 1fb29c45f5cf..a467de2b2fea 100644
>>  --- a/drivers/mfd/sec-core.c
>>  +++ b/drivers/mfd/sec-core.c
>>  @@ -455,7 +455,6 @@ static void sec_pmic_shutdown(struct i2c_client 
>> *i2c)
>>   	regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0);
>>   }
>> 
>>  -#ifdef CONFIG_PM_SLEEP
>>   static int sec_pmic_suspend(struct device *dev)
> 
> Did you test W=1 with !CONFIG_PM_SLEEP? No warnings?

I tested the PR with !CONFIG_PM_SLEEP, correct. sec-core.o compiles 
fine. No warnings with W=1.
> 
Cheers,
-Paul



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

* Re: [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 20/28] mfd: arizona: " Paul Cercueil
  2022-08-07 17:33   ` kernel test robot
@ 2022-08-08  9:53   ` Richard Fitzgerald
  2022-08-08 10:06     ` Paul Cercueil
  1 sibling, 1 reply; 63+ messages in thread
From: Richard Fitzgerald @ 2022-08-08  9:53 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones; +Cc: linux-kernel, patches

On 07/08/2022 15:52, Paul Cercueil wrote:
> Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
> suspend/resume functions (and related code) outside #ifdef guards.
> 
> If CONFIG_PM is not set, the arizona_pm_ops will be defined as
> "static __maybe_unused", and the structure plus all the callbacks will
> be automatically dropped by the compiler.
> 
> The advantage is then that these functions are now always compiled
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: patches@opensource.cirrus.com
> ---
>   drivers/mfd/arizona-core.c | 21 +++++++++++----------
>   drivers/mfd/arizona-i2c.c  |  2 +-
>   drivers/mfd/arizona-spi.c  |  2 +-
>   3 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
> index cbf1dd90b70d..c1acc9521f83 100644
> --- a/drivers/mfd/arizona-core.c
> +++ b/drivers/mfd/arizona-core.c
> @@ -480,7 +480,6 @@ static int wm5102_clear_write_sequencer(struct arizona *arizona)
>   	return 0;
>   }
>   
> -#ifdef CONFIG_PM
>   static int arizona_isolate_dcvdd(struct arizona *arizona)

__maybe_unused?

>   {
>   	int ret;
> @@ -742,9 +741,7 @@ static int arizona_runtime_suspend(struct device *dev)

__maybe_unused?

>   
>   	return 0;
>   }
> -#endif
>   
> -#ifdef CONFIG_PM_SLEEP
>   static int arizona_suspend(struct device *dev)

__maybe_unused?

>   {
>   	struct arizona *arizona = dev_get_drvdata(dev);
> @@ -784,17 +781,21 @@ static int arizona_resume(struct device *dev)

__maybe_unused?

>   
>   	return 0;
>   }
> -#endif
>   
> +#ifndef CONFIG_PM
> +static __maybe_unused
> +#endif

No need to ifdef a __maybe_unused.

>   const struct dev_pm_ops arizona_pm_ops = {
> -	SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
> -			   arizona_runtime_resume,
> -			   NULL)
> -	SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
> -	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
> -				      arizona_resume_noirq)
> +	RUNTIME_PM_OPS(arizona_runtime_suspend,
> +		       arizona_runtime_resume,
> +		       NULL)
> +	SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
> +	NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
> +				  arizona_resume_noirq)
>   };
> +#ifdef CONFIG_PM
>   EXPORT_SYMBOL_GPL(arizona_pm_ops);
> +#endif

This ifdeffing is ugly. Why must the structure only be exported if
CONFIG_PM is set?

>   
>   #ifdef CONFIG_OF
>   static int arizona_of_get_core_pdata(struct arizona *arizona)
> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
> index 6d83e6b9a692..8799d9183bee 100644
> --- a/drivers/mfd/arizona-i2c.c
> +++ b/drivers/mfd/arizona-i2c.c
> @@ -119,7 +119,7 @@ static const struct of_device_id arizona_i2c_of_match[] = {
>   static struct i2c_driver arizona_i2c_driver = {
>   	.driver = {
>   		.name	= "arizona",
> -		.pm	= &arizona_pm_ops,
> +		.pm	= pm_ptr(&arizona_pm_ops),
>   		.of_match_table	= of_match_ptr(arizona_i2c_of_match),
>   	},
>   	.probe		= arizona_i2c_probe,
> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
> index 941b0267d09d..da05b966d48c 100644
> --- a/drivers/mfd/arizona-spi.c
> +++ b/drivers/mfd/arizona-spi.c
> @@ -282,7 +282,7 @@ static const struct of_device_id arizona_spi_of_match[] = {
>   static struct spi_driver arizona_spi_driver = {
>   	.driver = {
>   		.name	= "arizona",
> -		.pm	= &arizona_pm_ops,
> +		.pm	= pm_ptr(&arizona_pm_ops),
>   		.of_match_table	= of_match_ptr(arizona_spi_of_match),
>   		.acpi_match_table = ACPI_PTR(arizona_acpi_match),
>   	},

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

* Re: [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-08  9:28     ` Paul Cercueil
@ 2022-08-08 10:06       ` Krzysztof Kozlowski
  2022-08-08 10:14         ` Paul Cercueil
  0 siblings, 1 reply; 63+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-08 10:06 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Lee Jones, linux-kernel, Bartlomiej Zolnierkiewicz, linux-samsung-soc

On 08/08/2022 12:28, Paul Cercueil wrote:
> Hi Krzysztof,
> 
> Le lun., août 8 2022 at 12:11:02 +0300, Krzysztof Kozlowski 
> <krzysztof.kozlowski@linaro.org> a écrit :
>> On 07/08/2022 17:52, Paul Cercueil wrote:
>>>  Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
>>>  to handle the .suspend/.resume callbacks.
>>>
>>>  These macros allow the suspend and resume functions to be 
>>> automatically
>>>  dropped by the compiler when CONFIG_SUSPEND is disabled, without 
>>> having
>>>  to use #ifdef guards.
>>>
>>>  The advantage is then that these functions are now always compiled
>>>  independently of any Kconfig option, and thanks to that bugs and
>>>  regressions are easier to catch.
>>>
>>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>>  Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>  Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>>
>> The address does not work. Please don't add it to commit log.
> 
> That's what get-maintainers gave me, and I didn't get any error sending 
> at that address. 

I know, I was bugging Bartlomiej and other Samsung folks to fix it and
we reached some kind of conclusion but it never resulted in a patch.

> But I'll take your word.
> 
>>>  Cc: linux-samsung-soc@vger.kernel.org
>>
>> This is also not really needed in commit log... it's just a mailing 
>> list...
>>
>> I actually never understood why people want to add to commit log, so 
>> to
>> something which will last 10 years, Cc-ing other folks, instead of
>> adding such tags after '---'. Imagine 10 years from now:
>>
>> 1. What's the point to be cced on this patch after 10 years instead of
>> using maintainers file (the one in 10 years)? Why Cc-ing me in 10 
>> years?
>> If I am a maintainer of this driver in that time, I will be C-ced 
>> based
>> on maintainers file. If I am not a maintainer in 10 years, why the 
>> heck
>> cc-ing me based on some 10-year old commit? Just because I was a
>> maintainer once, like 10 years ago?
>>
>> 2. Or why cc-ing such people when backporting to stable?
>>
>> It's quite a lot of unnecessary emails which many of us won't actually
>> handle later...
>>
>> I sincerely admit I was once also adding such Cc-tags. But that time 
>> my
>> employer was counting lines-of-patch (including commit log)... crazy, 
>> right?
> 
> Yeah, well, I can add these tags after the '---' line. Nobody ever told 
> me that I was doing it wrong, and I see Cc: tags quite often in commit 
> messages, so I thought it was common practice.

It indeed is a practice, which I do not understand. :) My complaining
about it was just complaining, not as a feedback required to change.

> 
>>>  ---
>>>   drivers/mfd/sec-core.c | 7 +++----
>>>   1 file changed, 3 insertions(+), 4 deletions(-)
>>>
>>>  diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
>>>  index 1fb29c45f5cf..a467de2b2fea 100644
>>>  --- a/drivers/mfd/sec-core.c
>>>  +++ b/drivers/mfd/sec-core.c
>>>  @@ -455,7 +455,6 @@ static void sec_pmic_shutdown(struct i2c_client 
>>> *i2c)
>>>   	regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0);
>>>   }
>>>
>>>  -#ifdef CONFIG_PM_SLEEP
>>>   static int sec_pmic_suspend(struct device *dev)
>>
>> Did you test W=1 with !CONFIG_PM_SLEEP? No warnings?
> 
> I tested the PR with !CONFIG_PM_SLEEP, correct. sec-core.o compiles 
> fine. No warnings with W=1.

Ah, I see now. _DEFINE_DEV_PM_OPS uses __maybe_unused for such case.

Looks fine then. With dropped Bartlomiej Cc:

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


Best regards,
Krzysztof

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

* Re: [PATCH 22/28] mfd: max77686: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 22/28] mfd: max77686: " Paul Cercueil
  2022-08-08  9:11   ` Krzysztof Kozlowski
@ 2022-08-08 10:06   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 63+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-08 10:06 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: linux-kernel, Chanwoo Choi, Bartlomiej Zolnierkiewicz

On 07/08/2022 17:52, Paul Cercueil wrote:
> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> to handle the .suspend/.resume callbacks.
> 
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use #ifdef guards.
> 
> The advantage is then that these functions are now always compiled
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

With dropped Bartlomiej:

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


Best regards,
Krzysztof

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

* Re: [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-08  9:53   ` Richard Fitzgerald
@ 2022-08-08 10:06     ` Paul Cercueil
  2022-08-08 10:43       ` Richard Fitzgerald
  0 siblings, 1 reply; 63+ messages in thread
From: Paul Cercueil @ 2022-08-08 10:06 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: Lee Jones, linux-kernel, patches

Hi Richard,

Le lun., août 8 2022 at 10:53:54 +0100, Richard Fitzgerald 
<rf@opensource.cirrus.com> a écrit :
> On 07/08/2022 15:52, Paul Cercueil wrote:
>> Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
>> suspend/resume functions (and related code) outside #ifdef guards.
>> 
>> If CONFIG_PM is not set, the arizona_pm_ops will be defined as
>> "static __maybe_unused", and the structure plus all the callbacks 
>> will
>> be automatically dropped by the compiler.
>> 
>> The advantage is then that these functions are now always compiled
>> independently of any Kconfig option, and thanks to that bugs and
>> regressions are easier to catch.
>> 
>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>> Cc: patches@opensource.cirrus.com
>> ---
>>   drivers/mfd/arizona-core.c | 21 +++++++++++----------
>>   drivers/mfd/arizona-i2c.c  |  2 +-
>>   drivers/mfd/arizona-spi.c  |  2 +-
>>   3 files changed, 13 insertions(+), 12 deletions(-)
>> 
>> diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
>> index cbf1dd90b70d..c1acc9521f83 100644
>> --- a/drivers/mfd/arizona-core.c
>> +++ b/drivers/mfd/arizona-core.c
>> @@ -480,7 +480,6 @@ static int wm5102_clear_write_sequencer(struct 
>> arizona *arizona)
>>   	return 0;
>>   }
>>   \x7f-#ifdef CONFIG_PM
>>   static int arizona_isolate_dcvdd(struct arizona *arizona)
> 
> __maybe_unused?

No need. The symbols are always referenced.

>>   {
>>   	int ret;
>> @@ -742,9 +741,7 @@ static int arizona_runtime_suspend(struct device 
>> *dev)
> 
> __maybe_unused?
> 
>>   \x7f  	return 0;
>>   }
>> -#endif
>>   \x7f-#ifdef CONFIG_PM_SLEEP
>>   static int arizona_suspend(struct device *dev)
> 
> __maybe_unused?
> 
>>   {
>>   	struct arizona *arizona = dev_get_drvdata(dev);
>> @@ -784,17 +781,21 @@ static int arizona_resume(struct device *dev)
> 
> __maybe_unused?
> 
>>   \x7f  	return 0;
>>   }
>> -#endif
>>   \x7f+#ifndef CONFIG_PM
>> +static __maybe_unused
>> +#endif
> 
> No need to ifdef a __maybe_unused.

Yes, it is needed, because the symbol is conditionally exported. If 
!CONFIG_PM, we want the compiler to discard the dev_pm_ops and all the 
callbacks, hence the "static __maybe_unused". That's the same trick 
used in _EXPORT_DEV_PM_OPS().

(note that this patch is broken as it does not change the struct name, 
in the !PM case, which causes conflicts with the .h. I'll fix in v2)

>>   const struct dev_pm_ops arizona_pm_ops = {
>> -	SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
>> -			   arizona_runtime_resume,
>> -			   NULL)
>> -	SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>> -	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>> -				      arizona_resume_noirq)
>> +	RUNTIME_PM_OPS(arizona_runtime_suspend,
>> +		       arizona_runtime_resume,
>> +		       NULL)
>> +	SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>> +	NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>> +				  arizona_resume_noirq)
>>   };
>> +#ifdef CONFIG_PM
>>   EXPORT_SYMBOL_GPL(arizona_pm_ops);
>> +#endif
> 
> This ifdeffing is ugly. Why must the structure only be exported if
> CONFIG_PM is set?

So that all the PM code is garbage-collected by the compiler if 
!CONFIG_PM.

Ideally I would use something like EXPORT_SIMPLE_DEV_PM_OPS() which 
would make the patch much cleaner, but it doesn't support noirq 
callbacks - and that's why I suggested in the cover letter that maybe a 
new PM macro can be added if this patch is deemed too messy.

Cheers,
-Paul

>>   \x7f  #ifdef CONFIG_OF
>>   static int arizona_of_get_core_pdata(struct arizona *arizona)
>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>> index 6d83e6b9a692..8799d9183bee 100644
>> --- a/drivers/mfd/arizona-i2c.c
>> +++ b/drivers/mfd/arizona-i2c.c
>> @@ -119,7 +119,7 @@ static const struct of_device_id 
>> arizona_i2c_of_match[] = {
>>   static struct i2c_driver arizona_i2c_driver = {
>>   	.driver = {
>>   		.name	= "arizona",
>> -		.pm	= &arizona_pm_ops,
>> +		.pm	= pm_ptr(&arizona_pm_ops),
>>   		.of_match_table	= of_match_ptr(arizona_i2c_of_match),
>>   	},
>>   	.probe		= arizona_i2c_probe,
>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>> index 941b0267d09d..da05b966d48c 100644
>> --- a/drivers/mfd/arizona-spi.c
>> +++ b/drivers/mfd/arizona-spi.c
>> @@ -282,7 +282,7 @@ static const struct of_device_id 
>> arizona_spi_of_match[] = {
>>   static struct spi_driver arizona_spi_driver = {
>>   	.driver = {
>>   		.name	= "arizona",
>> -		.pm	= &arizona_pm_ops,
>> +		.pm	= pm_ptr(&arizona_pm_ops),
>>   		.of_match_table	= of_match_ptr(arizona_spi_of_match),
>>   		.acpi_match_table = ACPI_PTR(arizona_acpi_match),
>>   	},



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

* Re: [PATCH 21/28] mfd: max14577: Remove #ifdef guards for PM related functions
  2022-08-07 14:52 ` [PATCH 21/28] mfd: max14577: " Paul Cercueil
  2022-08-08  9:11   ` Krzysztof Kozlowski
@ 2022-08-08 10:06   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 63+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-08 10:06 UTC (permalink / raw)
  To: Paul Cercueil, Lee Jones
  Cc: linux-kernel, Chanwoo Choi, Bartlomiej Zolnierkiewicz

On 07/08/2022 17:52, Paul Cercueil wrote:
> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> to handle the .suspend/.resume callbacks.
> 
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use #ifdef guards.
> 
> The advantage is then that these functions are now always compiled
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

With dropped Bartlomiej:

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


Best regards,
Krzysztof

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

* Re: [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-08 10:06       ` Krzysztof Kozlowski
@ 2022-08-08 10:14         ` Paul Cercueil
  0 siblings, 0 replies; 63+ messages in thread
From: Paul Cercueil @ 2022-08-08 10:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Lee Jones, linux-kernel, Bartlomiej Zolnierkiewicz, linux-samsung-soc


[...]

>>>>   ---
>>>>    drivers/mfd/sec-core.c | 7 +++----
>>>>    1 file changed, 3 insertions(+), 4 deletions(-)
>>>> 
>>>>   diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
>>>>   index 1fb29c45f5cf..a467de2b2fea 100644
>>>>   --- a/drivers/mfd/sec-core.c
>>>>   +++ b/drivers/mfd/sec-core.c
>>>>   @@ -455,7 +455,6 @@ static void sec_pmic_shutdown(struct 
>>>> i2c_client
>>>>  *i2c)
>>>>    	regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0);
>>>>    }
>>>> 
>>>>   -#ifdef CONFIG_PM_SLEEP
>>>>    static int sec_pmic_suspend(struct device *dev)
>>> 
>>>  Did you test W=1 with !CONFIG_PM_SLEEP? No warnings?
>> 
>>  I tested the PR with !CONFIG_PM_SLEEP, correct. sec-core.o compiles
>>  fine. No warnings with W=1.
> 
> Ah, I see now. _DEFINE_DEV_PM_OPS uses __maybe_unused for such case.

Actually it doesn't :) Since the (dev_pm_ops) structure is always (and 
should always be) referenced through pm_sleep_ptr() or pm_ptr(), the 
symbols are never seen as unused by the compiler, but are automatically 
dropped by the compiler when the related config option is turned off.

Cheers,
-Paul



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

* Re: [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-08 10:06     ` Paul Cercueil
@ 2022-08-08 10:43       ` Richard Fitzgerald
  2022-08-08 11:01         ` Paul Cercueil
  0 siblings, 1 reply; 63+ messages in thread
From: Richard Fitzgerald @ 2022-08-08 10:43 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Lee Jones, linux-kernel, patches

On 08/08/2022 11:06, Paul Cercueil wrote:
> Hi Richard,
> 
> Le lun., août 8 2022 at 10:53:54 +0100, Richard Fitzgerald 
> <rf@opensource.cirrus.com> a écrit :
>> On 07/08/2022 15:52, Paul Cercueil wrote:
>>> Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
>>> suspend/resume functions (and related code) outside #ifdef guards.
>>>
>>> If CONFIG_PM is not set, the arizona_pm_ops will be defined as
>>> "static __maybe_unused", and the structure plus all the callbacks will
>>> be automatically dropped by the compiler.
>>>
>>> The advantage is then that these functions are now always compiled
>>> independently of any Kconfig option, and thanks to that bugs and
>>> regressions are easier to catch.
>>>
>>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>> Cc: patches@opensource.cirrus.com
>>> ---
>>>   drivers/mfd/arizona-core.c | 21 +++++++++++----------
>>>   drivers/mfd/arizona-i2c.c  |  2 +-
>>>   drivers/mfd/arizona-spi.c  |  2 +-
>>>   3 files changed, 13 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
>>> index cbf1dd90b70d..c1acc9521f83 100644
>>> --- a/drivers/mfd/arizona-core.c
>>> +++ b/drivers/mfd/arizona-core.c
>>> @@ -480,7 +480,6 @@ static int wm5102_clear_write_sequencer(struct 
>>> arizona *arizona)
>>>       return 0;
>>>   }
>>>   \x7f-#ifdef CONFIG_PM
>>>   static int arizona_isolate_dcvdd(struct arizona *arizona)
>>
>> __maybe_unused?
> 
> No need. The symbols are always referenced.
> 
>>>   {
>>>       int ret;
>>> @@ -742,9 +741,7 @@ static int arizona_runtime_suspend(struct device 
>>> *dev)
>>
>> __maybe_unused?
>>
>>>   \x7f      return 0;
>>>   }
>>> -#endif
>>>   \x7f-#ifdef CONFIG_PM_SLEEP
>>>   static int arizona_suspend(struct device *dev)
>>
>> __maybe_unused?
>>
>>>   {
>>>       struct arizona *arizona = dev_get_drvdata(dev);
>>> @@ -784,17 +781,21 @@ static int arizona_resume(struct device *dev)
>>
>> __maybe_unused?
>>
>>>   \x7f      return 0;
>>>   }
>>> -#endif
>>>   \x7f+#ifndef CONFIG_PM
>>> +static __maybe_unused
>>> +#endif
>>
>> No need to ifdef a __maybe_unused.
> 
> Yes, it is needed, because the symbol is conditionally exported. If

Why conditionally export it?

> !CONFIG_PM, we want the compiler to discard the dev_pm_ops
  and all the
> callbacks, hence the "static __maybe_unused". That's the same trick used > in _EXPORT_DEV_PM_OPS().
> 
> (note that this patch is broken as it does not change the struct name, 
> in the !PM case, which causes conflicts with the .h. I'll fix in v2)
> 
>>>   const struct dev_pm_ops arizona_pm_ops = {
>>> -    SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
>>> -               arizona_runtime_resume,
>>> -               NULL)
>>> -    SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>>> -    SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>>> -                      arizona_resume_noirq)
>>> +    RUNTIME_PM_OPS(arizona_runtime_suspend,
>>> +               arizona_runtime_resume,
>>> +               NULL)
>>> +    SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>>> +    NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>>> +                  arizona_resume_noirq)
>>>   };
>>> +#ifdef CONFIG_PM
>>>   EXPORT_SYMBOL_GPL(arizona_pm_ops);
>>> +#endif
>>
>> This ifdeffing is ugly. Why must the structure only be exported if
>> CONFIG_PM is set?
> 
> So that all the PM code is garbage-collected by the compiler if !CONFIG_PM.

The functions will be dropped if they are not referenced. That doesn't
answer why the struct must not be exported.

What is the aim of omitting the struct export?

> 
> Ideally I would use something like EXPORT_SIMPLE_DEV_PM_OPS() which 
> would make the patch much cleaner, but it doesn't support noirq 
> callbacks - and that's why I suggested in the cover letter that maybe a 
> new PM macro can be added if this patch is deemed too messy.
> 
> Cheers,
> -Paul
> 
>>>   \x7f  #ifdef CONFIG_OF
>>>   static int arizona_of_get_core_pdata(struct arizona *arizona)
>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>> index 6d83e6b9a692..8799d9183bee 100644
>>> --- a/drivers/mfd/arizona-i2c.c
>>> +++ b/drivers/mfd/arizona-i2c.c
>>> @@ -119,7 +119,7 @@ static const struct of_device_id 
>>> arizona_i2c_of_match[] = {
>>>   static struct i2c_driver arizona_i2c_driver = {
>>>       .driver = {
>>>           .name    = "arizona",
>>> -        .pm    = &arizona_pm_ops,
>>> +        .pm    = pm_ptr(&arizona_pm_ops),
>>>           .of_match_table    = of_match_ptr(arizona_i2c_of_match),
>>>       },
>>>       .probe        = arizona_i2c_probe,
>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>> index 941b0267d09d..da05b966d48c 100644
>>> --- a/drivers/mfd/arizona-spi.c
>>> +++ b/drivers/mfd/arizona-spi.c
>>> @@ -282,7 +282,7 @@ static const struct of_device_id 
>>> arizona_spi_of_match[] = {
>>>   static struct spi_driver arizona_spi_driver = {
>>>       .driver = {
>>>           .name    = "arizona",
>>> -        .pm    = &arizona_pm_ops,
>>> +        .pm    = pm_ptr(&arizona_pm_ops),
>>>           .of_match_table    = of_match_ptr(arizona_spi_of_match),
>>>           .acpi_match_table = ACPI_PTR(arizona_acpi_match),
>>>       },
> 
> 

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

* Re: [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-08 10:43       ` Richard Fitzgerald
@ 2022-08-08 11:01         ` Paul Cercueil
  2022-08-08 14:00           ` Richard Fitzgerald
  0 siblings, 1 reply; 63+ messages in thread
From: Paul Cercueil @ 2022-08-08 11:01 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: Lee Jones, linux-kernel, patches



Le lun., août 8 2022 at 11:43:31 +0100, Richard Fitzgerald 
<rf@opensource.cirrus.com> a écrit :
> On 08/08/2022 11:06, Paul Cercueil wrote:
>> Hi Richard,
>> 
>> Le lun., août 8 2022 at 10:53:54 +0100, Richard Fitzgerald 
>> \x7f<rf@opensource.cirrus.com> a écrit :
>>> On 07/08/2022 15:52, Paul Cercueil wrote:
>>>> Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
>>>> suspend/resume functions (and related code) outside #ifdef guards.
>>>> 
>>>> If CONFIG_PM is not set, the arizona_pm_ops will be defined as
>>>> "static __maybe_unused", and the structure plus all the callbacks 
>>>> will
>>>> be automatically dropped by the compiler.
>>>> 
>>>> The advantage is then that these functions are now always compiled
>>>> independently of any Kconfig option, and thanks to that bugs and
>>>> regressions are easier to catch.
>>>> 
>>>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>>> Cc: patches@opensource.cirrus.com
>>>> ---
>>>>   drivers/mfd/arizona-core.c | 21 +++++++++++----------
>>>>   drivers/mfd/arizona-i2c.c  |  2 +-
>>>>   drivers/mfd/arizona-spi.c  |  2 +-
>>>>   3 files changed, 13 insertions(+), 12 deletions(-)
>>>> 
>>>> diff --git a/drivers/mfd/arizona-core.c 
>>>> b/drivers/mfd/arizona-core.c
>>>> index cbf1dd90b70d..c1acc9521f83 100644
>>>> --- a/drivers/mfd/arizona-core.c
>>>> +++ b/drivers/mfd/arizona-core.c
>>>> @@ -480,7 +480,6 @@ static int wm5102_clear_write_sequencer(struct 
>>>> \x7f\x7f\x7farizona *arizona)
>>>>       return 0;
>>>>   }
>>>>   \x7f-#ifdef CONFIG_PM
>>>>   static int arizona_isolate_dcvdd(struct arizona *arizona)
>>> 
>>> __maybe_unused?
>> 
>> No need. The symbols are always referenced.
>> 
>>>>   {
>>>>       int ret;
>>>> @@ -742,9 +741,7 @@ static int arizona_runtime_suspend(struct 
>>>> device \x7f\x7f\x7f*dev)
>>> 
>>> __maybe_unused?
>>> 
>>>>   \x7f      return 0;
>>>>   }
>>>> -#endif
>>>>   \x7f-#ifdef CONFIG_PM_SLEEP
>>>>   static int arizona_suspend(struct device *dev)
>>> 
>>> __maybe_unused?
>>> 
>>>>   {
>>>>       struct arizona *arizona = dev_get_drvdata(dev);
>>>> @@ -784,17 +781,21 @@ static int arizona_resume(struct device *dev)
>>> 
>>> __maybe_unused?
>>> 
>>>>   \x7f      return 0;
>>>>   }
>>>> -#endif
>>>>   \x7f+#ifndef CONFIG_PM
>>>> +static __maybe_unused
>>>> +#endif
>>> 
>>> No need to ifdef a __maybe_unused.
>> 
>> Yes, it is needed, because the symbol is conditionally exported. If
> 
> Why conditionally export it?
> 
>> !CONFIG_PM, we want the compiler to discard the dev_pm_ops
>  and all the
>> callbacks, hence the "static __maybe_unused". That's the same trick 
>> used > in _EXPORT_DEV_PM_OPS().
>> 
>> (note that this patch is broken as it does not change the struct 
>> name, \x7fin the !PM case, which causes conflicts with the .h. I'll fix 
>> in v2)
>> 
>>>>   const struct dev_pm_ops arizona_pm_ops = {
>>>> -    SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
>>>> -               arizona_runtime_resume,
>>>> -               NULL)
>>>> -    SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>>>> -    SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>>>> -                      arizona_resume_noirq)
>>>> +    RUNTIME_PM_OPS(arizona_runtime_suspend,
>>>> +               arizona_runtime_resume,
>>>> +               NULL)
>>>> +    SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>>>> +    NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>>>> +                  arizona_resume_noirq)
>>>>   };
>>>> +#ifdef CONFIG_PM
>>>>   EXPORT_SYMBOL_GPL(arizona_pm_ops);
>>>> +#endif
>>> 
>>> This ifdeffing is ugly. Why must the structure only be exported if
>>> CONFIG_PM is set?
>> 
>> So that all the PM code is garbage-collected by the compiler if 
>> !CONFIG_PM.
> 
> The functions will be dropped if they are not referenced. That doesn't
> answer why the struct must not be exported.
> 
> What is the aim of omitting the struct export?

The functions are always referenced by the dev_pm_ops structure. 
Omitting the struct export means that the struct can now be a "static 
__maybe_unused" symbol in the !CONFIG_PM case, and everything related 
to PM will be automatically removed by the compiler.

Otherwise, the symbol is exported as usual. The symbol being 
conditionally exported is not a problem - the struct is always 
referenced (as it should be) using the pm_sleep_ptr() or pm_ptr() 
macros.

This is basically what EXPORT_SIMPLE_DEV_PM_OPS() does by the way.

Cheers,
-Paul

>> 
>> Ideally I would use something like EXPORT_SIMPLE_DEV_PM_OPS() which 
>> \x7fwould make the patch much cleaner, but it doesn't support noirq 
>> \x7fcallbacks - and that's why I suggested in the cover letter that 
>> maybe a \x7fnew PM macro can be added if this patch is deemed too messy.
>> 
>> Cheers,
>> -Paul
>> 
>>>>   \x7f  #ifdef CONFIG_OF
>>>>   static int arizona_of_get_core_pdata(struct arizona *arizona)
>>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>>> index 6d83e6b9a692..8799d9183bee 100644
>>>> --- a/drivers/mfd/arizona-i2c.c
>>>> +++ b/drivers/mfd/arizona-i2c.c
>>>> @@ -119,7 +119,7 @@ static const struct of_device_id 
>>>> \x7f\x7f\x7farizona_i2c_of_match[] = {
>>>>   static struct i2c_driver arizona_i2c_driver = {
>>>>       .driver = {
>>>>           .name    = "arizona",
>>>> -        .pm    = &arizona_pm_ops,
>>>> +        .pm    = pm_ptr(&arizona_pm_ops),
>>>>           .of_match_table    = of_match_ptr(arizona_i2c_of_match),
>>>>       },
>>>>       .probe        = arizona_i2c_probe,
>>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>>> index 941b0267d09d..da05b966d48c 100644
>>>> --- a/drivers/mfd/arizona-spi.c
>>>> +++ b/drivers/mfd/arizona-spi.c
>>>> @@ -282,7 +282,7 @@ static const struct of_device_id 
>>>> \x7f\x7f\x7farizona_spi_of_match[] = {
>>>>   static struct spi_driver arizona_spi_driver = {
>>>>       .driver = {
>>>>           .name    = "arizona",
>>>> -        .pm    = &arizona_pm_ops,
>>>> +        .pm    = pm_ptr(&arizona_pm_ops),
>>>>           .of_match_table    = of_match_ptr(arizona_spi_of_match),
>>>>           .acpi_match_table = ACPI_PTR(arizona_acpi_match),
>>>>       },
>> 
>> 



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

* Re: [PATCH 11/28] mfd: intel_soc_pmic: Remove #ifdef guards for PM related functions
  2022-08-07 15:58     ` Paul Cercueil
@ 2022-08-08 11:56       ` Andy Shevchenko
  2022-08-08 12:13         ` Lee Jones
  0 siblings, 1 reply; 63+ messages in thread
From: Andy Shevchenko @ 2022-08-08 11:56 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Lee Jones, Linux Kernel Mailing List, Andy Shevchenko

On Sun, Aug 7, 2022 at 5:58 PM Paul Cercueil <paul@crapouillou.net> wrote:
> Le dim., août 7 2022 at 17:50:32 +0200, Andy Shevchenko
> <andy.shevchenko@gmail.com> a écrit :
> > On Sun, Aug 7, 2022 at 4:53 PM Paul Cercueil <paul@crapouillou.net>
> > wrote:

...

> >>  The advantage is then that these functions are now always compiled
> >
> > is that
>
> I think that what I wrote is proper English.

Okay, Google just shows 100x times less the above form in comparison
to one w/o "then".

> >>  independently of any Kconfig option, and thanks to that bugs and
> >>  regressions are easier to catch.

...

> > 3. The PMIC core actually is Crystal Cove driver and I have a pending
> > series for that and I guess you know about it. Have you seen what have
> > been done there?
>
> No, I didn't know. I guess Lee can skip my patch 11/28 then.

I probably memorized the name of a guy, who sent a patch against this
driver a week ago or so, wrongly. Sorry for that.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 11/28] mfd: intel_soc_pmic: Remove #ifdef guards for PM related functions
  2022-08-08 11:56       ` Andy Shevchenko
@ 2022-08-08 12:13         ` Lee Jones
  0 siblings, 0 replies; 63+ messages in thread
From: Lee Jones @ 2022-08-08 12:13 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Paul Cercueil, Linux Kernel Mailing List, Andy Shevchenko, Lee Jones

On Mon, 08 Aug 2022, Andy Shevchenko wrote:

> On Sun, Aug 7, 2022 at 5:58 PM Paul Cercueil <paul@crapouillou.net> wrote:
> > Le dim., août 7 2022 at 17:50:32 +0200, Andy Shevchenko
> > <andy.shevchenko@gmail.com> a écrit :
> > > On Sun, Aug 7, 2022 at 4:53 PM Paul Cercueil <paul@crapouillou.net>
> > > wrote:
> 
> ...
> 
> > >>  The advantage is then that these functions are now always compiled
> > >
> > > is that
> >
> > I think that what I wrote is proper English.
> 
> Okay, Google just shows 100x times less the above form in comparison
> to one w/o "then".

> The advantage is then that these functions are now always compile
> independently of any Kconfig option, and thanks to that bugs and
> regressions are easier to catch.

 "This has the advantage of always compiling these functions in,
  independently of any Kconfig option.  Thanks to that, bugs and other
  regressions are subsequently easier to catch."

> > >>  independently of any Kconfig option, and thanks to that bugs and
> > >>  regressions are easier to catch.
> 
> ...
> 
> > > 3. The PMIC core actually is Crystal Cove driver and I have a pending
> > > series for that and I guess you know about it. Have you seen what have
> > > been done there?
> >
> > No, I didn't know. I guess Lee can skip my patch 11/28 then.
> 
> I probably memorized the name of a guy, who sent a patch against this
> driver a week ago or so, wrongly. Sorry for that.
> 

-- 
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-08 11:01         ` Paul Cercueil
@ 2022-08-08 14:00           ` Richard Fitzgerald
  2022-08-08 14:47             ` Lee Jones
  0 siblings, 1 reply; 63+ messages in thread
From: Richard Fitzgerald @ 2022-08-08 14:00 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Lee Jones, linux-kernel, patches

On 08/08/2022 12:01, Paul Cercueil wrote:
> 
> 
> Le lun., août 8 2022 at 11:43:31 +0100, Richard Fitzgerald 
> <rf@opensource.cirrus.com> a écrit :
>> On 08/08/2022 11:06, Paul Cercueil wrote:
>>> Hi Richard,
>>>
>>> Le lun., août 8 2022 at 10:53:54 +0100, Richard Fitzgerald 
>>> \x7f<rf@opensource.cirrus.com> a écrit :
>>>> On 07/08/2022 15:52, Paul Cercueil wrote:
>>>>> Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
>>>>> suspend/resume functions (and related code) outside #ifdef guards.
>>>>>
>>>>> If CONFIG_PM is not set, the arizona_pm_ops will be defined as
>>>>> "static __maybe_unused", and the structure plus all the callbacks will
>>>>> be automatically dropped by the compiler.
>>>>>
>>>>> The advantage is then that these functions are now always compiled
>>>>> independently of any Kconfig option, and thanks to that bugs and
>>>>> regressions are easier to catch.
>>>>>
>>>>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>>>> Cc: patches@opensource.cirrus.com
>>>>> ---
>>>>>   drivers/mfd/arizona-core.c | 21 +++++++++++----------
>>>>>   drivers/mfd/arizona-i2c.c  |  2 +-
>>>>>   drivers/mfd/arizona-spi.c  |  2 +-
>>>>>   3 files changed, 13 insertions(+), 12 deletions(-)
>>>>>
>>>>> diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
>>>>> index cbf1dd90b70d..c1acc9521f83 100644
>>>>> --- a/drivers/mfd/arizona-core.c
>>>>> +++ b/drivers/mfd/arizona-core.c
>>>>> @@ -480,7 +480,6 @@ static int 
>>>>> wm5102_clear_write_sequencer(struct \x7f\x7f\x7farizona *arizona)
>>>>>       return 0;
>>>>>   }
>>>>>   \x7f-#ifdef CONFIG_PM
>>>>>   static int arizona_isolate_dcvdd(struct arizona *arizona)
>>>>
>>>> __maybe_unused?
>>>
>>> No need. The symbols are always referenced.
>>>
>>>>>   {
>>>>>       int ret;
>>>>> @@ -742,9 +741,7 @@ static int arizona_runtime_suspend(struct 
>>>>> device \x7f\x7f\x7f*dev)
>>>>
>>>> __maybe_unused?
>>>>
>>>>>   \x7f      return 0;
>>>>>   }
>>>>> -#endif
>>>>>   \x7f-#ifdef CONFIG_PM_SLEEP
>>>>>   static int arizona_suspend(struct device *dev)
>>>>
>>>> __maybe_unused?
>>>>
>>>>>   {
>>>>>       struct arizona *arizona = dev_get_drvdata(dev);
>>>>> @@ -784,17 +781,21 @@ static int arizona_resume(struct device *dev)
>>>>
>>>> __maybe_unused?
>>>>
>>>>>   \x7f      return 0;
>>>>>   }
>>>>> -#endif
>>>>>   \x7f+#ifndef CONFIG_PM
>>>>> +static __maybe_unused
>>>>> +#endif
>>>>
>>>> No need to ifdef a __maybe_unused.
>>>
>>> Yes, it is needed, because the symbol is conditionally exported. If
>>
>> Why conditionally export it?
>>
>>> !CONFIG_PM, we want the compiler to discard the dev_pm_ops
>>  and all the
>>> callbacks, hence the "static __maybe_unused". That's the same trick 
>>> used > in _EXPORT_DEV_PM_OPS().
>>>
>>> (note that this patch is broken as it does not change the struct 
>>> name, \x7fin the !PM case, which causes conflicts with the .h. I'll fix 
>>> in v2)
>>>
>>>>>   const struct dev_pm_ops arizona_pm_ops = {
>>>>> -    SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
>>>>> -               arizona_runtime_resume,
>>>>> -               NULL)
>>>>> -    SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>>>>> -    SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>>>>> -                      arizona_resume_noirq)
>>>>> +    RUNTIME_PM_OPS(arizona_runtime_suspend,
>>>>> +               arizona_runtime_resume,
>>>>> +               NULL)
>>>>> +    SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
>>>>> +    NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
>>>>> +                  arizona_resume_noirq)
>>>>>   };
>>>>> +#ifdef CONFIG_PM
>>>>>   EXPORT_SYMBOL_GPL(arizona_pm_ops);
>>>>> +#endif
>>>>
>>>> This ifdeffing is ugly. Why must the structure only be exported if
>>>> CONFIG_PM is set?
>>>
>>> So that all the PM code is garbage-collected by the compiler if 
>>> !CONFIG_PM.
>>
>> The functions will be dropped if they are not referenced. That doesn't
>> answer why the struct must not be exported.
>>
>> What is the aim of omitting the struct export?
> 
> The functions are always referenced by the dev_pm_ops structure. 
> Omitting the struct export means that the struct can now be a "static 
> __maybe_unused" symbol in the !CONFIG_PM case, and everything related to 
> PM will be automatically removed by the compiler.
> 
> Otherwise, the symbol is exported as usual. The symbol being 
> conditionally exported is not a problem - the struct is always 
> referenced (as it should be) using the pm_sleep_ptr() or pm_ptr() macros.
> 
> This is basically what EXPORT_SIMPLE_DEV_PM_OPS() does by the way.
> 
> Cheers,
> -Paul
> 
Ok,
Well ultimately it's up to Lee as the maintainer of the MFD subsystem.

But the open-coded #ifdef around "static __maybe_unused" is ugly, so if
this is going to be a common pattern a new macro would be nice.

>>>
>>> Ideally I would use something like EXPORT_SIMPLE_DEV_PM_OPS() which 
>>> \x7fwould make the patch much cleaner, but it doesn't support noirq 
>>> \x7fcallbacks - and that's why I suggested in the cover letter that 
>>> maybe a \x7fnew PM macro can be added if this patch is deemed too messy.
>>>
>>> Cheers,
>>> -Paul
>>>
>>>>>   \x7f  #ifdef CONFIG_OF
>>>>>   static int arizona_of_get_core_pdata(struct arizona *arizona)
>>>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>>>> index 6d83e6b9a692..8799d9183bee 100644
>>>>> --- a/drivers/mfd/arizona-i2c.c
>>>>> +++ b/drivers/mfd/arizona-i2c.c
>>>>> @@ -119,7 +119,7 @@ static const struct of_device_id 
>>>>> \x7f\x7f\x7farizona_i2c_of_match[] = {
>>>>>   static struct i2c_driver arizona_i2c_driver = {
>>>>>       .driver = {
>>>>>           .name    = "arizona",
>>>>> -        .pm    = &arizona_pm_ops,
>>>>> +        .pm    = pm_ptr(&arizona_pm_ops),
>>>>>           .of_match_table    = of_match_ptr(arizona_i2c_of_match),
>>>>>       },
>>>>>       .probe        = arizona_i2c_probe,
>>>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>>>> index 941b0267d09d..da05b966d48c 100644
>>>>> --- a/drivers/mfd/arizona-spi.c
>>>>> +++ b/drivers/mfd/arizona-spi.c
>>>>> @@ -282,7 +282,7 @@ static const struct of_device_id 
>>>>> \x7f\x7f\x7farizona_spi_of_match[] = {
>>>>>   static struct spi_driver arizona_spi_driver = {
>>>>>       .driver = {
>>>>>           .name    = "arizona",
>>>>> -        .pm    = &arizona_pm_ops,
>>>>> +        .pm    = pm_ptr(&arizona_pm_ops),
>>>>>           .of_match_table    = of_match_ptr(arizona_spi_of_match),
>>>>>           .acpi_match_table = ACPI_PTR(arizona_acpi_match),
>>>>>       },
>>>
>>>
> 
> 

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

* Re: [PATCH 20/28] mfd: arizona: Remove #ifdef guards for PM related functions
  2022-08-08 14:00           ` Richard Fitzgerald
@ 2022-08-08 14:47             ` Lee Jones
  0 siblings, 0 replies; 63+ messages in thread
From: Lee Jones @ 2022-08-08 14:47 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: Paul Cercueil, linux-kernel, patches, Lee Jones

On Mon, 08 Aug 2022, Richard Fitzgerald wrote:

> On 08/08/2022 12:01, Paul Cercueil wrote:
> > 
> > 
> > Le lun., août 8 2022 at 11:43:31 +0100, Richard Fitzgerald
> > <rf@opensource.cirrus.com> a écrit :
> > > On 08/08/2022 11:06, Paul Cercueil wrote:
> > > > Hi Richard,
> > > > 
> > > > Le lun., août 8 2022 at 10:53:54 +0100, Richard Fitzgerald
> > > > \x7f<rf@opensource.cirrus.com> a écrit :
> > > > > On 07/08/2022 15:52, Paul Cercueil wrote:
> > > > > > Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
> > > > > > suspend/resume functions (and related code) outside #ifdef guards.
> > > > > > 
> > > > > > If CONFIG_PM is not set, the arizona_pm_ops will be defined as
> > > > > > "static __maybe_unused", and the structure plus all the callbacks will
> > > > > > be automatically dropped by the compiler.
> > > > > > 
> > > > > > The advantage is then that these functions are now always compiled
> > > > > > independently of any Kconfig option, and thanks to that bugs and
> > > > > > regressions are easier to catch.
> > > > > > 
> > > > > > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > > > > > Cc: patches@opensource.cirrus.com
> > > > > > ---
> > > > > >   drivers/mfd/arizona-core.c | 21 +++++++++++----------
> > > > > >   drivers/mfd/arizona-i2c.c  |  2 +-
> > > > > >   drivers/mfd/arizona-spi.c  |  2 +-
> > > > > >   3 files changed, 13 insertions(+), 12 deletions(-)
> > > > > > 
> > > > > > diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
> > > > > > index cbf1dd90b70d..c1acc9521f83 100644
> > > > > > --- a/drivers/mfd/arizona-core.c
> > > > > > +++ b/drivers/mfd/arizona-core.c
> > > > > > @@ -480,7 +480,6 @@ static int
> > > > > > wm5102_clear_write_sequencer(struct \x7f\x7f\x7farizona *arizona)
> > > > > >       return 0;
> > > > > >   }
> > > > > >   \x7f-#ifdef CONFIG_PM
> > > > > >   static int arizona_isolate_dcvdd(struct arizona *arizona)
> > > > > 
> > > > > __maybe_unused?
> > > > 
> > > > No need. The symbols are always referenced.
> > > > 
> > > > > >   {
> > > > > >       int ret;
> > > > > > @@ -742,9 +741,7 @@ static int
> > > > > > arizona_runtime_suspend(struct device \x7f\x7f\x7f*dev)
> > > > > 
> > > > > __maybe_unused?
> > > > > 
> > > > > >   \x7f      return 0;
> > > > > >   }
> > > > > > -#endif
> > > > > >   \x7f-#ifdef CONFIG_PM_SLEEP
> > > > > >   static int arizona_suspend(struct device *dev)
> > > > > 
> > > > > __maybe_unused?
> > > > > 
> > > > > >   {
> > > > > >       struct arizona *arizona = dev_get_drvdata(dev);
> > > > > > @@ -784,17 +781,21 @@ static int arizona_resume(struct device *dev)
> > > > > 
> > > > > __maybe_unused?
> > > > > 
> > > > > >   \x7f      return 0;
> > > > > >   }
> > > > > > -#endif
> > > > > >   \x7f+#ifndef CONFIG_PM
> > > > > > +static __maybe_unused
> > > > > > +#endif
> > > > > 
> > > > > No need to ifdef a __maybe_unused.
> > > > 
> > > > Yes, it is needed, because the symbol is conditionally exported. If
> > > 
> > > Why conditionally export it?
> > > 
> > > > !CONFIG_PM, we want the compiler to discard the dev_pm_ops
> > >  and all the
> > > > callbacks, hence the "static __maybe_unused". That's the same
> > > > trick used > in _EXPORT_DEV_PM_OPS().
> > > > 
> > > > (note that this patch is broken as it does not change the struct
> > > > name, \x7fin the !PM case, which causes conflicts with the .h. I'll
> > > > fix in v2)
> > > > 
> > > > > >   const struct dev_pm_ops arizona_pm_ops = {
> > > > > > -    SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
> > > > > > -               arizona_runtime_resume,
> > > > > > -               NULL)
> > > > > > -    SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
> > > > > > -    SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
> > > > > > -                      arizona_resume_noirq)
> > > > > > +    RUNTIME_PM_OPS(arizona_runtime_suspend,
> > > > > > +               arizona_runtime_resume,
> > > > > > +               NULL)
> > > > > > +    SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
> > > > > > +    NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
> > > > > > +                  arizona_resume_noirq)
> > > > > >   };
> > > > > > +#ifdef CONFIG_PM
> > > > > >   EXPORT_SYMBOL_GPL(arizona_pm_ops);
> > > > > > +#endif
> > > > > 
> > > > > This ifdeffing is ugly. Why must the structure only be exported if
> > > > > CONFIG_PM is set?
> > > > 
> > > > So that all the PM code is garbage-collected by the compiler if
> > > > !CONFIG_PM.
> > > 
> > > The functions will be dropped if they are not referenced. That doesn't
> > > answer why the struct must not be exported.
> > > 
> > > What is the aim of omitting the struct export?
> > 
> > The functions are always referenced by the dev_pm_ops structure.
> > Omitting the struct export means that the struct can now be a "static
> > __maybe_unused" symbol in the !CONFIG_PM case, and everything related to
> > PM will be automatically removed by the compiler.
> > 
> > Otherwise, the symbol is exported as usual. The symbol being
> > conditionally exported is not a problem - the struct is always
> > referenced (as it should be) using the pm_sleep_ptr() or pm_ptr()
> > macros.
> > 
> > This is basically what EXPORT_SIMPLE_DEV_PM_OPS() does by the way.
> > 
> > Cheers,
> > -Paul
> > 
> Ok,
> Well ultimately it's up to Lee as the maintainer of the MFD subsystem.
> 
> But the open-coded #ifdef around "static __maybe_unused" is ugly, so if
> this is going to be a common pattern a new macro would be nice.

I like to avoid #ifery in C files wherever possible.

-- 
DEPRECATED: Please use lee@kernel.org

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

* Re: [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-08  9:11   ` Krzysztof Kozlowski
  2022-08-08  9:28     ` Paul Cercueil
@ 2022-08-09 15:33     ` Lee Jones
  2022-08-09 15:51       ` Krzysztof Kozlowski
  1 sibling, 1 reply; 63+ messages in thread
From: Lee Jones @ 2022-08-09 15:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Paul Cercueil, linux-kernel, Bartlomiej Zolnierkiewicz,
	linux-samsung-soc, Lee Jones

On Mon, 08 Aug 2022, Krzysztof Kozlowski wrote:

> On 07/08/2022 17:52, Paul Cercueil wrote:
> > Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> > to handle the .suspend/.resume callbacks.
> > 
> > These macros allow the suspend and resume functions to be automatically
> > dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> > to use #ifdef guards.
> > 
> > The advantage is then that these functions are now always compiled
> > independently of any Kconfig option, and thanks to that bugs and
> > regressions are easier to catch.
> > 
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> 
> The address does not work. Please don't add it to commit log.
> 
> > Cc: linux-samsung-soc@vger.kernel.org
> 
> This is also not really needed in commit log... it's just a mailing list...
> 
> I actually never understood why people want to add to commit log, so to
> something which will last 10 years, Cc-ing other folks, instead of
> adding such tags after '---'. Imagine 10 years from now:
> 
> 1. What's the point to be cced on this patch after 10 years instead of
> using maintainers file (the one in 10 years)? Why Cc-ing me in 10 years?
> If I am a maintainer of this driver in that time, I will be C-ced based
> on maintainers file. If I am not a maintainer in 10 years, why the heck
> cc-ing me based on some 10-year old commit? Just because I was a
> maintainer once, like 10 years ago?

Why would that happen?

These tags are only used during initial submission.

> 2. Or why cc-ing such people when backporting to stable?

That doesn't happen either.

> It's quite a lot of unnecessary emails which many of us won't actually
> handle later...
> 
> I sincerely admit I was once also adding such Cc-tags. But that time my
> employer was counting lines-of-patch (including commit log)... crazy, right?

Nothing wrong with adding these tags IMHO.  It's what they're for.

I use them when I'm maintaining a large amount of out-of-tree, but
to-be-upstreamed patches over several versions.  Re-applying the
recipients list can become pretty labour-some after several
iterations.

Adding them under the '---' doesn't work when the purpose of them is
to keep the recipients list in Git history.

-- 
DEPRECATED: Please use lee@kernel.org

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

* Re: [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-09 15:33     ` Lee Jones
@ 2022-08-09 15:51       ` Krzysztof Kozlowski
  2022-08-09 17:26         ` Lee Jones
  0 siblings, 1 reply; 63+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-09 15:51 UTC (permalink / raw)
  To: Lee Jones
  Cc: Paul Cercueil, linux-kernel, Bartlomiej Zolnierkiewicz,
	linux-samsung-soc, Lee Jones

On 09/08/2022 18:33, Lee Jones wrote:
> On Mon, 08 Aug 2022, Krzysztof Kozlowski wrote:
> 
>> On 07/08/2022 17:52, Paul Cercueil wrote:
>>> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
>>> to handle the .suspend/.resume callbacks.
>>>
>>> These macros allow the suspend and resume functions to be automatically
>>> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
>>> to use #ifdef guards.
>>>
>>> The advantage is then that these functions are now always compiled
>>> independently of any Kconfig option, and thanks to that bugs and
>>> regressions are easier to catch.
>>>
>>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>>
>> The address does not work. Please don't add it to commit log.
>>
>>> Cc: linux-samsung-soc@vger.kernel.org
>>
>> This is also not really needed in commit log... it's just a mailing list...
>>
>> I actually never understood why people want to add to commit log, so to
>> something which will last 10 years, Cc-ing other folks, instead of
>> adding such tags after '---'. Imagine 10 years from now:
>>
>> 1. What's the point to be cced on this patch after 10 years instead of
>> using maintainers file (the one in 10 years)? Why Cc-ing me in 10 years?
>> If I am a maintainer of this driver in that time, I will be C-ced based
>> on maintainers file. If I am not a maintainer in 10 years, why the heck
>> cc-ing me based on some 10-year old commit? Just because I was a
>> maintainer once, like 10 years ago?
> 
> Why would that happen?
> 
> These tags are only used during initial submission.

No, the tags are used in any other resends, backports etc while
traveling through different trees. I think only stable-backports do not
use them, but all other gfp+git-send will follow the tags.

> 
>> 2. Or why cc-ing such people when backporting to stable?
> 
> That doesn't happen either.

Indeed, stable does not use these Cc.

> 
>> It's quite a lot of unnecessary emails which many of us won't actually
>> handle later...
>>
>> I sincerely admit I was once also adding such Cc-tags. But that time my
>> employer was counting lines-of-patch (including commit log)... crazy, right?
> 
> Nothing wrong with adding these tags IMHO.  It's what they're for.
> 
> I use them when I'm maintaining a large amount of out-of-tree, but
> to-be-upstreamed patches over several versions.  Re-applying the
> recipients list can become pretty labour-some after several
> iterations.

You can do it still while keeping the tags after ---. Only patch-related
workflows strip such tags. If you cherry-pick, rebase, merge, you always
get the content of ---.

The same as typical changelog (not cover letter but one in the patch) -
you keep it after --- and it does not disappear.

> 
> Adding them under the '---' doesn't work when the purpose of them is
> to keep the recipients list in Git history.

This I understand, what I did not understand (and you did not explain)
is what would be the purpose to keep them in Git history. What is the
point to have them in commit log of 10 year old commit?

Best regards,
Krzysztof

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

* Re: [PATCH 13/28] mfd: sec: Remove #ifdef guards for PM related functions
  2022-08-09 15:51       ` Krzysztof Kozlowski
@ 2022-08-09 17:26         ` Lee Jones
  0 siblings, 0 replies; 63+ messages in thread
From: Lee Jones @ 2022-08-09 17:26 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Paul Cercueil, linux-kernel, Bartlomiej Zolnierkiewicz,
	linux-samsung-soc, Lee Jones

On Tue, 09 Aug 2022, Krzysztof Kozlowski wrote:

> On 09/08/2022 18:33, Lee Jones wrote:
> > On Mon, 08 Aug 2022, Krzysztof Kozlowski wrote:
> > 
> >> On 07/08/2022 17:52, Paul Cercueil wrote:
> >>> Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
> >>> to handle the .suspend/.resume callbacks.
> >>>
> >>> These macros allow the suspend and resume functions to be automatically
> >>> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> >>> to use #ifdef guards.
> >>>
> >>> The advantage is then that these functions are now always compiled
> >>> independently of any Kconfig option, and thanks to that bugs and
> >>> regressions are easier to catch.
> >>>
> >>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> >>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> >>
> >> The address does not work. Please don't add it to commit log.
> >>
> >>> Cc: linux-samsung-soc@vger.kernel.org
> >>
> >> This is also not really needed in commit log... it's just a mailing list...
> >>
> >> I actually never understood why people want to add to commit log, so to
> >> something which will last 10 years, Cc-ing other folks, instead of
> >> adding such tags after '---'. Imagine 10 years from now:
> >>
> >> 1. What's the point to be cced on this patch after 10 years instead of
> >> using maintainers file (the one in 10 years)? Why Cc-ing me in 10 years?
> >> If I am a maintainer of this driver in that time, I will be C-ced based
> >> on maintainers file. If I am not a maintainer in 10 years, why the heck
> >> cc-ing me based on some 10-year old commit? Just because I was a
> >> maintainer once, like 10 years ago?
> > 
> > Why would that happen?
> > 
> > These tags are only used during initial submission.
> 
> No, the tags are used in any other resends, backports etc while
> traveling through different trees. I think only stable-backports do not
> use them, but all other gfp+git-send will follow the tags.
> 
> > 
> >> 2. Or why cc-ing such people when backporting to stable?
> > 
> > That doesn't happen either.
> 
> Indeed, stable does not use these Cc.
> 
> >> It's quite a lot of unnecessary emails which many of us won't actually
> >> handle later...
> >>
> >> I sincerely admit I was once also adding such Cc-tags. But that time my
> >> employer was counting lines-of-patch (including commit log)... crazy, right?
> > 
> > Nothing wrong with adding these tags IMHO.  It's what they're for.
> > 
> > I use them when I'm maintaining a large amount of out-of-tree, but
> > to-be-upstreamed patches over several versions.  Re-applying the
> > recipients list can become pretty labour-some after several
> > iterations.
> 
> You can do it still while keeping the tags after ---. Only patch-related
> workflows strip such tags. If you cherry-pick, rebase, merge, you always
> get the content of ---.
> 
> The same as typical changelog (not cover letter but one in the patch) -
> you keep it after --- and it does not disappear.

I'll have to try this next time.

> > Adding them under the '---' doesn't work when the purpose of them is
> > to keep the recipients list in Git history.
> 
> This I understand, what I did not understand (and you did not explain)
> is what would be the purpose to keep them in Git history. What is the
> point to have them in commit log of 10 year old commit?

Here is a documented use for the tags:

 "If a person has had the opportunity to comment on a patch, but has not
  provided such comments, you may optionally add a ``Cc:`` tag to the patch."

Thus, when a recipient replies with a *-by tag, I strip out the
corresponding Cc: line.

Obviously this does not apply to mailing lists.

-- 
DEPRECATED: Please use lee@kernel.org

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

end of thread, other threads:[~2022-08-09 17:26 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-07 14:52 [PATCH 00/28] mfd: Remove #ifdef guards for PM functions Paul Cercueil
2022-08-07 14:52 ` [PATCH 01/28] mfd: 88pm80x: Remove #ifdef guards for PM related functions Paul Cercueil
2022-08-07 14:52 ` [PATCH 02/28] mfd: aat2870: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 03/28] mfd: adp5520: " Paul Cercueil
2022-08-08  7:46   ` Hennerich, Michael
2022-08-07 14:52 ` [PATCH 04/28] mfd: max8925-i2c: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 05/28] mfd: mt6397-irq: " Paul Cercueil
2022-08-07 14:52   ` Paul Cercueil
2022-08-07 14:52 ` [PATCH 06/28] mfd: pcf50633: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 07/28] mfd: rc5t583-irq: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 08/28] mfd: stpmic1: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 09/28] mfd: ucb1x00: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 10/28] mfd: 88pm860x: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 11/28] mfd: intel_soc_pmic: " Paul Cercueil
2022-08-07 15:50   ` Andy Shevchenko
2022-08-07 15:58     ` Paul Cercueil
2022-08-08 11:56       ` Andy Shevchenko
2022-08-08 12:13         ` Lee Jones
2022-08-07 14:52 ` [PATCH 12/28] mfd: mcp-sa11x0: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 13/28] mfd: sec: " Paul Cercueil
2022-08-08  9:11   ` Krzysztof Kozlowski
2022-08-08  9:28     ` Paul Cercueil
2022-08-08 10:06       ` Krzysztof Kozlowski
2022-08-08 10:14         ` Paul Cercueil
2022-08-09 15:33     ` Lee Jones
2022-08-09 15:51       ` Krzysztof Kozlowski
2022-08-09 17:26         ` Lee Jones
2022-08-07 14:52 ` [PATCH 14/28] mfd: sm501: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 15/28] mfd: tc6387xb: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 16/28] mfd: tps6586x: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 17/28] mfd: wm8994: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 18/28] mfd: max77620: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 19/28] mfd: t7l66xb: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 20/28] mfd: arizona: " Paul Cercueil
2022-08-07 17:33   ` kernel test robot
2022-08-08  9:53   ` Richard Fitzgerald
2022-08-08 10:06     ` Paul Cercueil
2022-08-08 10:43       ` Richard Fitzgerald
2022-08-08 11:01         ` Paul Cercueil
2022-08-08 14:00           ` Richard Fitzgerald
2022-08-08 14:47             ` Lee Jones
2022-08-07 14:52 ` [PATCH 21/28] mfd: max14577: " Paul Cercueil
2022-08-08  9:11   ` Krzysztof Kozlowski
2022-08-08 10:06   ` Krzysztof Kozlowski
2022-08-07 14:52 ` [PATCH 22/28] mfd: max77686: " Paul Cercueil
2022-08-08  9:11   ` Krzysztof Kozlowski
2022-08-08 10:06   ` Krzysztof Kozlowski
2022-08-07 14:52 ` [PATCH 23/28] mfd: motorola-cpcap: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 24/28] mfd: sprd-sc27xx: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 25/28] mfd: stmfx: " Paul Cercueil
2022-08-07 14:52   ` Paul Cercueil
2022-08-07 16:00   ` kernel test robot
2022-08-07 16:00     ` kernel test robot
2022-08-07 18:15   ` kernel test robot
2022-08-07 18:15     ` kernel test robot
2022-08-07 14:52 ` [PATCH 26/28] mfd: stmpe: " Paul Cercueil
2022-08-07 14:52   ` Paul Cercueil
2022-08-07 16:42   ` kernel test robot
2022-08-07 16:42     ` kernel test robot
2022-08-07 17:13   ` kernel test robot
2022-08-07 17:13     ` kernel test robot
2022-08-07 14:52 ` [PATCH 27/28] mfd: tc3589x: " Paul Cercueil
2022-08-07 14:52 ` [PATCH 28/28] mfd: tc6393xb: " Paul Cercueil

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.