linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/23] i2c: Use new PM macros
@ 2023-07-05 20:42 Paul Cercueil
  2023-07-05 20:42 ` [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions Paul Cercueil
                   ` (18 more replies)
  0 siblings, 19 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Elie Morisse,
	Shyam Sundar S K, Ray Jui, Scott Branden, Kamal Dasu,
	Broadcom internal kernel review list, Florian Fainelli,
	Bartosz Golaszewski, Jarkko Nikula, Andy Shevchenko,
	Mika Westerberg, Jan Dabros, Jean Delvare, Qii Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, Linus Walleij,
	Peter Korsgaard, Andrew Lunn, Vladimir Zapolskiy, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Wolfram Sang, Krzysztof Kozlowski,
	Alim Akhtar, Conghui Chen, Viresh Kumar, Peter Rosin,
	linux-arm-kernel, linux-arm-msm, linux-mediatek,
	linux-renesas-soc, linux-samsung-soc, virtualization

Hi Wolfram,

This patchset converts the I2C subsystem to use the PM macros that were
introduced in v5.17, which allow the dev_pm_ops and related callbacks to
be automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

The point of this, is that all this code is now compiled independently
of any Kconfig option, which makes bugs and regressions easier to catch.

This continues the work that has been started in other subsystems (DRM,
IIO, watchdog).

As an added bonus, the diff is 71+/192-, that means less code you will
have to maintain ;)

The patches generally don't change the behaviour, with a few exceptions,
that are documented in the corresponding patches.

I would like to draw the attention to a few patches in particular:

- [01/23] the driver most likely does something that it shouldn't do
  (use the same callbacks for runtime PM and system PM). The patch does
  not change this behaviour but I have questions.

- [11/23] uses platform_driver.{suspend,resume} instead of the regular
  .driver.pm. I have no idea why it does that and I believe it doesn't
  really have to.

- [18/23] I feel like the qup_i2c_suspend / qup_i2c_resume don't really
  need to exist, and the pm_runtime_force_suspend() /
  pm_runtime_force_resume() helpers should be used instead, using the
  DEFINE_RUNTIME_DEV_PM_OPS() macro.

Cheers,
-Paul

Paul Cercueil (23):
  i2c: amd-mp2: Remove #ifdef guards for PM related functions
  i2c: au1550: Remove #ifdef guards for PM related functions
  i2c: iproc: Remove #ifdef guards for PM related functions
  i2c: brcmstb: Remove #ifdef guards for PM related functions
  i2c: davinci: Remove #ifdef guards for PM related functions
  i2c: designware: Remove #ifdef guards for PM related functions
  i2c: exynos5: Remove #ifdef guards for PM related functions
  i2c: hix5hd2: Remove #ifdef guards for PM related functions
  i2c: i801: Remove #ifdef guards for PM related functions
  i2c: img-scb: Remove #ifdef guards for PM related functions
  i2c: kempld: Remove #ifdef guards for PM related functions
  i2c: lpc2k: Remove #ifdef guards for PM related functions
  i2c: mt65xx: Remove #ifdef guards for PM related functions
  i2c: nomadik: Remove #ifdef guards for PM related functions
  i2c: ocores: Remove #ifdef guards for PM related functions
  i2c: pnx: Remove #ifdef guards for PM related functions
  i2c: pxa: Remove #ifdef guards for PM related functions
  i2c: qup: Remove #ifdef guards for PM related functions
  i2c: rcar: Remove #ifdef guards for PM related functions
  i2c: s3c2410: Remove #ifdef guards for PM related functions
  i2c: sh-mobile: Remove #ifdef guards for PM related functions
  i2c: virtio: Remove #ifdef guards for PM related functions
  i2c: mux: pca954x: Remove #ifdef guards for PM related functions

 drivers/i2c/busses/i2c-amd-mp2-pci.c        | 14 +++++--------
 drivers/i2c/busses/i2c-amd-mp2-plat.c       |  8 ++------
 drivers/i2c/busses/i2c-amd-mp2.h            |  2 --
 drivers/i2c/busses/i2c-au1550.c             | 15 +++-----------
 drivers/i2c/busses/i2c-bcm-iproc.c          | 10 +---------
 drivers/i2c/busses/i2c-brcmstb.c            |  8 +++-----
 drivers/i2c/busses/i2c-davinci.c            | 12 +++--------
 drivers/i2c/busses/i2c-designware-platdrv.c | 22 ++++++---------------
 drivers/i2c/busses/i2c-exynos5.c            |  8 +++-----
 drivers/i2c/busses/i2c-hix5hd2.c            | 10 ++++------
 drivers/i2c/busses/i2c-i801.c               |  6 ++----
 drivers/i2c/busses/i2c-img-scb.c            | 13 ++++--------
 drivers/i2c/busses/i2c-kempld.c             |  9 ++-------
 drivers/i2c/busses/i2c-lpc2k.c              |  8 +-------
 drivers/i2c/busses/i2c-mt65xx.c             |  8 +++-----
 drivers/i2c/busses/i2c-nomadik.c            | 14 +++++--------
 drivers/i2c/busses/i2c-ocores.c             | 10 +++-------
 drivers/i2c/busses/i2c-pnx.c                | 12 ++++-------
 drivers/i2c/busses/i2c-pxa.c                |  8 +-------
 drivers/i2c/busses/i2c-qup.c                | 16 ++++-----------
 drivers/i2c/busses/i2c-rcar.c               | 10 ++--------
 drivers/i2c/busses/i2c-s3c2410.c            | 14 +++----------
 drivers/i2c/busses/i2c-sh_mobile.c          | 12 +++--------
 drivers/i2c/busses/i2c-virtio.c             |  8 ++------
 drivers/i2c/muxes/i2c-mux-pca954x.c         |  6 ++----
 25 files changed, 71 insertions(+), 192 deletions(-)

-- 
2.40.1


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

* [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:09   ` Jonathan Cameron
  2023-07-05 20:42 ` [PATCH 02/23] i2c: au1550: " Paul Cercueil
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Elie Morisse,
	Shyam Sundar S K

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that the use of the UNIVERSAL_DEV_PM_OPS() macro was likely to be
wrong, as it sets the same callbacks for the runtime-PM and system
suspend/resume. This patch does not change this behaviour, but I suspect
that it should be changed to use DEFINE_RUNTIME_DEV_PM_OPS() instead, as
the current documentation for UNIVERSAL_DEV_PM_OPS() suggests.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Elie Morisse <syniurge@gmail.com>
Cc: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
---
 drivers/i2c/busses/i2c-amd-mp2-pci.c  | 14 +++++---------
 drivers/i2c/busses/i2c-amd-mp2-plat.c |  8 ++------
 drivers/i2c/busses/i2c-amd-mp2.h      |  2 --
 3 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c
index 143165300949..114fe329279a 100644
--- a/drivers/i2c/busses/i2c-amd-mp2-pci.c
+++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c
@@ -382,7 +382,6 @@ static void amd_mp2_pci_remove(struct pci_dev *pci_dev)
 	amd_mp2_clear_reg(privdata);
 }
 
-#ifdef CONFIG_PM
 static int amd_mp2_pci_suspend(struct device *dev)
 {
 	struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -434,9 +433,10 @@ static int amd_mp2_pci_resume(struct device *dev)
 	return ret;
 }
 
-static UNIVERSAL_DEV_PM_OPS(amd_mp2_pci_pm_ops, amd_mp2_pci_suspend,
-			    amd_mp2_pci_resume, NULL);
-#endif /* CONFIG_PM */
+static const struct dev_pm_ops amd_mp2_pci_pm_ops = {
+	SYSTEM_SLEEP_PM_OPS(amd_mp2_pci_suspend, amd_mp2_pci_resume)
+	RUNTIME_PM_OPS(amd_mp2_pci_suspend, amd_mp2_pci_resume, NULL)
+};
 
 static const struct pci_device_id amd_mp2_pci_tbl[] = {
 	{PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_MP2)},
@@ -449,11 +449,7 @@ static struct pci_driver amd_mp2_pci_driver = {
 	.id_table	= amd_mp2_pci_tbl,
 	.probe		= amd_mp2_pci_probe,
 	.remove		= amd_mp2_pci_remove,
-#ifdef CONFIG_PM
-	.driver = {
-		.pm	= &amd_mp2_pci_pm_ops,
-	},
-#endif
+	.driver.pm	= pm_ptr(&amd_mp2_pci_pm_ops),
 };
 module_pci_driver(amd_mp2_pci_driver);
 
diff --git a/drivers/i2c/busses/i2c-amd-mp2-plat.c b/drivers/i2c/busses/i2c-amd-mp2-plat.c
index 112fe2bc5662..4c677aeaca29 100644
--- a/drivers/i2c/busses/i2c-amd-mp2-plat.c
+++ b/drivers/i2c/busses/i2c-amd-mp2-plat.c
@@ -183,7 +183,6 @@ static const struct i2c_algorithm i2c_amd_algorithm = {
 	.functionality = i2c_amd_func,
 };
 
-#ifdef CONFIG_PM
 static int i2c_amd_suspend(struct amd_i2c_common *i2c_common)
 {
 	struct amd_i2c_dev *i2c_dev = amd_i2c_dev_common(i2c_common);
@@ -198,7 +197,6 @@ static int i2c_amd_resume(struct amd_i2c_common *i2c_common)
 
 	return i2c_amd_enable_set(i2c_dev, true);
 }
-#endif
 
 static const u32 supported_speeds[] = {
 	I2C_MAX_HIGH_SPEED_MODE_FREQ,
@@ -276,10 +274,8 @@ static int i2c_amd_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, i2c_dev);
 
 	i2c_dev->common.cmd_completion = &i2c_amd_cmd_completion;
-#ifdef CONFIG_PM
-	i2c_dev->common.suspend = &i2c_amd_suspend;
-	i2c_dev->common.resume = &i2c_amd_resume;
-#endif
+	i2c_dev->common.suspend = pm_ptr(&i2c_amd_suspend);
+	i2c_dev->common.resume = pm_ptr(&i2c_amd_resume);
 
 	/* Register the adapter */
 	amd_mp2_pm_runtime_get(mp2_dev);
diff --git a/drivers/i2c/busses/i2c-amd-mp2.h b/drivers/i2c/busses/i2c-amd-mp2.h
index 018a42de8b1e..40f3cdcc60aa 100644
--- a/drivers/i2c/busses/i2c-amd-mp2.h
+++ b/drivers/i2c/busses/i2c-amd-mp2.h
@@ -160,10 +160,8 @@ struct amd_i2c_common {
 	enum speed_enum i2c_speed;
 	u8 *dma_buf;
 	dma_addr_t dma_addr;
-#ifdef CONFIG_PM
 	int (*suspend)(struct amd_i2c_common *i2c_common);
 	int (*resume)(struct amd_i2c_common *i2c_common);
-#endif /* CONFIG_PM */
 };
 
 /**
-- 
2.40.1


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

* [PATCH 02/23] i2c: au1550: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
  2023-07-05 20:42 ` [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:10   ` Jonathan Cameron
  2023-07-05 20:42 ` [PATCH 03/23] i2c: iproc: " Paul Cercueil
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Paul Cercueil

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that the behaviour is slightly different than before; the original
code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
resulted in these functions being compiled in but never used when
CONFIG_PM_SLEEP was disabled.

Now, those functions are only compiled in when CONFIG_PM_SLEEP is
enabled.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/i2c/busses/i2c-au1550.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c
index e66c12ecf270..8e43f25c117e 100644
--- a/drivers/i2c/busses/i2c-au1550.c
+++ b/drivers/i2c/busses/i2c-au1550.c
@@ -342,7 +342,6 @@ static void i2c_au1550_remove(struct platform_device *pdev)
 	i2c_au1550_disable(priv);
 }
 
-#ifdef CONFIG_PM
 static int i2c_au1550_suspend(struct device *dev)
 {
 	struct i2c_au1550_data *priv = dev_get_drvdata(dev);
@@ -361,21 +360,13 @@ static int i2c_au1550_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops i2c_au1550_pmops = {
-	.suspend	= i2c_au1550_suspend,
-	.resume		= i2c_au1550_resume,
-};
-
-#define AU1XPSC_SMBUS_PMOPS (&i2c_au1550_pmops)
-
-#else
-#define AU1XPSC_SMBUS_PMOPS NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(i2c_au1550_pmops,
+				i2c_au1550_suspend, i2c_au1550_resume);
 
 static struct platform_driver au1xpsc_smbus_driver = {
 	.driver = {
 		.name	= "au1xpsc_smbus",
-		.pm	= AU1XPSC_SMBUS_PMOPS,
+		.pm	= pm_sleep_ptr(&i2c_au1550_pmops),
 	},
 	.probe		= i2c_au1550_probe,
 	.remove_new	= i2c_au1550_remove,
-- 
2.40.1


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

* [PATCH 03/23] i2c: iproc: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
  2023-07-05 20:42 ` [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions Paul Cercueil
  2023-07-05 20:42 ` [PATCH 02/23] i2c: au1550: " Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:11   ` Jonathan Cameron
  2023-07-06 17:01   ` Ray Jui
  2023-07-05 20:42 ` [PATCH 04/23] i2c: brcmstb: " Paul Cercueil
                   ` (15 subsequent siblings)
  18 siblings, 2 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-arm-kernel

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/i2c/busses/i2c-bcm-iproc.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index 2d8342fdc25d..8a3e2208475c 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -1125,8 +1125,6 @@ static void bcm_iproc_i2c_remove(struct platform_device *pdev)
 	bcm_iproc_i2c_enable_disable(iproc_i2c, false);
 }
 
-#ifdef CONFIG_PM_SLEEP
-
 static int bcm_iproc_i2c_suspend(struct device *dev)
 {
 	struct bcm_iproc_i2c_dev *iproc_i2c = dev_get_drvdata(dev);
@@ -1177,12 +1175,6 @@ static const struct dev_pm_ops bcm_iproc_i2c_pm_ops = {
 	.resume_early = &bcm_iproc_i2c_resume
 };
 
-#define BCM_IPROC_I2C_PM_OPS (&bcm_iproc_i2c_pm_ops)
-#else
-#define BCM_IPROC_I2C_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
-
-
 static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave)
 {
 	struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(slave->adapter);
@@ -1255,7 +1247,7 @@ static struct platform_driver bcm_iproc_i2c_driver = {
 	.driver = {
 		.name = "bcm-iproc-i2c",
 		.of_match_table = bcm_iproc_i2c_of_match,
-		.pm = BCM_IPROC_I2C_PM_OPS,
+		.pm = pm_sleep_ptr(&bcm_iproc_i2c_pm_ops),
 	},
 	.probe = bcm_iproc_i2c_probe,
 	.remove_new = bcm_iproc_i2c_remove,
-- 
2.40.1


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

* [PATCH 04/23] i2c: brcmstb: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (2 preceding siblings ...)
  2023-07-05 20:42 ` [PATCH 03/23] i2c: iproc: " Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:12   ` Jonathan Cameron
  2023-07-05 20:42 ` [PATCH 05/23] i2c: davinci: " Paul Cercueil
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Kamal Dasu,
	Broadcom internal kernel review list, Florian Fainelli,
	linux-arm-kernel

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/i2c/busses/i2c-brcmstb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index cf92cbcb8c86..c778bcca95fe 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -697,7 +697,6 @@ static void brcmstb_i2c_remove(struct platform_device *pdev)
 	i2c_del_adapter(&dev->adapter);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int brcmstb_i2c_suspend(struct device *dev)
 {
 	struct brcmstb_i2c_dev *i2c_dev = dev_get_drvdata(dev);
@@ -715,10 +714,9 @@ static int brcmstb_i2c_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend,
-			 brcmstb_i2c_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend,
+				brcmstb_i2c_resume);
 
 static const struct of_device_id brcmstb_i2c_of_match[] = {
 	{.compatible = "brcm,brcmstb-i2c"},
@@ -732,7 +730,7 @@ static struct platform_driver brcmstb_i2c_driver = {
 	.driver = {
 		   .name = "brcmstb-i2c",
 		   .of_match_table = brcmstb_i2c_of_match,
-		   .pm = &brcmstb_i2c_pm,
+		   .pm = pm_sleep_ptr(&brcmstb_i2c_pm),
 		   },
 	.probe = brcmstb_i2c_probe,
 	.remove_new = brcmstb_i2c_remove,
-- 
2.40.1


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

* [PATCH 05/23] i2c: davinci: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (3 preceding siblings ...)
  2023-07-05 20:42 ` [PATCH 04/23] i2c: brcmstb: " Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:15   ` Jonathan Cameron
  2023-07-05 20:42 ` [PATCH 06/23] i2c: designware: " Paul Cercueil
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Bartosz Golaszewski,
	linux-arm-kernel

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that the behaviour is slightly different than before; the original
code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
resulted in these functions being compiled in but never used when
CONFIG_PM_SLEEP was disabled.

Now, those functions are only compiled in when CONFIG_PM_SLEEP is
enabled.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/i2c/busses/i2c-davinci.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 71b60778c643..52527189a7bf 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -902,7 +902,6 @@ static void davinci_i2c_remove(struct platform_device *pdev)
 	pm_runtime_disable(dev->dev);
 }
 
-#ifdef CONFIG_PM
 static int davinci_i2c_suspend(struct device *dev)
 {
 	struct davinci_i2c_dev *i2c_dev = dev_get_drvdata(dev);
@@ -926,15 +925,10 @@ static int davinci_i2c_resume(struct device *dev)
 static const struct dev_pm_ops davinci_i2c_pm = {
 	.suspend        = davinci_i2c_suspend,
 	.resume         = davinci_i2c_resume,
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				      pm_runtime_force_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				  pm_runtime_force_resume)
 };
 
-#define davinci_i2c_pm_ops (&davinci_i2c_pm)
-#else
-#define davinci_i2c_pm_ops NULL
-#endif
-
 static const struct platform_device_id davinci_i2c_driver_ids[] = {
 	{ .name = "i2c_davinci", },
 	{ /* sentinel */ }
@@ -947,7 +941,7 @@ static struct platform_driver davinci_i2c_driver = {
 	.id_table	= davinci_i2c_driver_ids,
 	.driver		= {
 		.name	= "i2c_davinci",
-		.pm	= davinci_i2c_pm_ops,
+		.pm	= pm_sleep_ptr(&davinci_i2c_pm),
 		.of_match_table = davinci_i2c_of_match,
 	},
 };
-- 
2.40.1


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

* [PATCH 06/23] i2c: designware: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (4 preceding siblings ...)
  2023-07-05 20:42 ` [PATCH 05/23] i2c: davinci: " Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:18   ` Jonathan Cameron
  2023-07-06  9:11   ` Andy Shevchenko
  2023-07-05 20:42 ` [PATCH 07/23] i2c: exynos5: " Paul Cercueil
                   ` (12 subsequent siblings)
  18 siblings, 2 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Jarkko Nikula,
	Andy Shevchenko, Mika Westerberg, Jan Dabros

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Jan Dabros <jsd@semihalf.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 22 ++++++---------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 970c1c3b0402..855b698e99c0 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -418,7 +418,6 @@ static void dw_i2c_plat_remove(struct platform_device *pdev)
 	reset_control_assert(dev->rst);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int dw_i2c_plat_prepare(struct device *dev)
 {
 	/*
@@ -429,11 +428,7 @@ static int dw_i2c_plat_prepare(struct device *dev)
 	 */
 	return !has_acpi_companion(dev);
 }
-#else
-#define dw_i2c_plat_prepare	NULL
-#endif
 
-#ifdef CONFIG_PM
 static int dw_i2c_plat_runtime_suspend(struct device *dev)
 {
 	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
@@ -447,7 +442,7 @@ static int dw_i2c_plat_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused dw_i2c_plat_suspend(struct device *dev)
+static int dw_i2c_plat_suspend(struct device *dev)
 {
 	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
 
@@ -468,7 +463,7 @@ static int dw_i2c_plat_runtime_resume(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
+static int dw_i2c_plat_resume(struct device *dev)
 {
 	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
 
@@ -479,16 +474,11 @@ static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops dw_i2c_dev_pm_ops = {
-	.prepare = dw_i2c_plat_prepare,
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)
-	SET_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL)
+	.prepare = pm_sleep_ptr(dw_i2c_plat_prepare),
+	LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)
+	RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL)
 };
 
-#define DW_I2C_DEV_PMOPS (&dw_i2c_dev_pm_ops)
-#else
-#define DW_I2C_DEV_PMOPS NULL
-#endif
-
 /* Work with hotplug and coldplug */
 MODULE_ALIAS("platform:i2c_designware");
 
@@ -499,7 +489,7 @@ static struct platform_driver dw_i2c_driver = {
 		.name	= "i2c_designware",
 		.of_match_table = of_match_ptr(dw_i2c_of_match),
 		.acpi_match_table = ACPI_PTR(dw_i2c_acpi_match),
-		.pm	= DW_I2C_DEV_PMOPS,
+		.pm	= pm_ptr(&dw_i2c_dev_pm_ops),
 	},
 };
 
-- 
2.40.1


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

* [PATCH 07/23] i2c: exynos5: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (5 preceding siblings ...)
  2023-07-05 20:42 ` [PATCH 06/23] i2c: designware: " Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:25   ` Jonathan Cameron
  2023-07-05 20:42 ` [PATCH 08/23] i2c: hix5hd2: " Paul Cercueil
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Krzysztof Kozlowski,
	Alim Akhtar, linux-arm-kernel, linux-samsung-soc

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
---
 drivers/i2c/busses/i2c-exynos5.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index f378cd479e55..5b201a326c13 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -892,7 +892,6 @@ static void exynos5_i2c_remove(struct platform_device *pdev)
 	clk_unprepare(i2c->pclk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int exynos5_i2c_suspend_noirq(struct device *dev)
 {
 	struct exynos5_i2c *i2c = dev_get_drvdata(dev);
@@ -934,11 +933,10 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
 	clk_disable_unprepare(i2c->pclk);
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops exynos5_i2c_dev_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos5_i2c_suspend_noirq,
-				      exynos5_i2c_resume_noirq)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos5_i2c_suspend_noirq,
+				  exynos5_i2c_resume_noirq)
 };
 
 static struct platform_driver exynos5_i2c_driver = {
@@ -946,7 +944,7 @@ static struct platform_driver exynos5_i2c_driver = {
 	.remove_new	= exynos5_i2c_remove,
 	.driver		= {
 		.name	= "exynos5-hsi2c",
-		.pm	= &exynos5_i2c_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&exynos5_i2c_dev_pm_ops),
 		.of_match_table = exynos5_i2c_match,
 	},
 };
-- 
2.40.1


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

* [PATCH 08/23] i2c: hix5hd2: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (6 preceding siblings ...)
  2023-07-05 20:42 ` [PATCH 07/23] i2c: exynos5: " Paul Cercueil
@ 2023-07-05 20:42 ` Paul Cercueil
  2023-07-06  2:27   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 09/23] i2c: i801: " Paul Cercueil
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:42 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Paul Cercueil

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that this driver should probably use the
DEFINE_RUNTIME_DEV_PM_OPS() macro, which would allow the devices to be
runtime-suspended on system suspend.

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

diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c
index 784a5f56eb76..8e75515c3ca4 100644
--- a/drivers/i2c/busses/i2c-hix5hd2.c
+++ b/drivers/i2c/busses/i2c-hix5hd2.c
@@ -475,7 +475,6 @@ static void hix5hd2_i2c_remove(struct platform_device *pdev)
 	pm_runtime_set_suspended(priv->dev);
 }
 
-#ifdef CONFIG_PM
 static int hix5hd2_i2c_runtime_suspend(struct device *dev)
 {
 	struct hix5hd2_i2c_priv *priv = dev_get_drvdata(dev);
@@ -494,12 +493,11 @@ static int hix5hd2_i2c_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops hix5hd2_i2c_pm_ops = {
-	SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
-			      hix5hd2_i2c_runtime_resume,
-			      NULL)
+	RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
+		       hix5hd2_i2c_runtime_resume,
+		       NULL)
 };
 
 static const struct of_device_id hix5hd2_i2c_match[] = {
@@ -513,7 +511,7 @@ static struct platform_driver hix5hd2_i2c_driver = {
 	.remove_new	= hix5hd2_i2c_remove,
 	.driver		= {
 		.name	= "hix5hd2-i2c",
-		.pm	= &hix5hd2_i2c_pm_ops,
+		.pm	= pm_ptr(&hix5hd2_i2c_pm_ops),
 		.of_match_table = hix5hd2_i2c_match,
 	},
 };
-- 
2.40.1


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

* [PATCH 09/23] i2c: i801: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (7 preceding siblings ...)
  2023-07-05 20:42 ` [PATCH 08/23] i2c: hix5hd2: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:28   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 10/23] i2c: img-scb: " Paul Cercueil
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Paul Cercueil, Jean Delvare

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Jean Delvare <jdelvare@suse.com>
---
 drivers/i2c/busses/i2c-i801.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 943b8e6d026d..73ae06432133 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1808,7 +1808,6 @@ static void i801_shutdown(struct pci_dev *dev)
 	pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int i801_suspend(struct device *dev)
 {
 	struct i801_priv *priv = dev_get_drvdata(dev);
@@ -1827,9 +1826,8 @@ static int i801_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume);
 
 static struct pci_driver i801_driver = {
 	.name		= DRV_NAME,
@@ -1838,7 +1836,7 @@ static struct pci_driver i801_driver = {
 	.remove		= i801_remove,
 	.shutdown	= i801_shutdown,
 	.driver		= {
-		.pm	= &i801_pm_ops,
+		.pm	= pm_sleep_ptr(&i801_pm_ops),
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
-- 
2.40.1


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

* [PATCH 10/23] i2c: img-scb: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (8 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 09/23] i2c: i801: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:31   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 11/23] i2c: kempld: " Paul Cercueil
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Paul Cercueil

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/i2c/busses/i2c-img-scb.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c
index 4b674cfbc6fb..a92e3082542e 100644
--- a/drivers/i2c/busses/i2c-img-scb.c
+++ b/drivers/i2c/busses/i2c-img-scb.c
@@ -1454,7 +1454,6 @@ static int img_i2c_runtime_resume(struct device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int img_i2c_suspend(struct device *dev)
 {
 	struct img_i2c *i2c = dev_get_drvdata(dev);
@@ -1482,14 +1481,10 @@ static int img_i2c_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static const struct dev_pm_ops img_i2c_pm = {
-	SET_RUNTIME_PM_OPS(img_i2c_runtime_suspend,
-			   img_i2c_runtime_resume,
-			   NULL)
-	SET_SYSTEM_SLEEP_PM_OPS(img_i2c_suspend, img_i2c_resume)
-};
+static _DEFINE_DEV_PM_OPS(img_i2c_pm, img_i2c_suspend, img_i2c_resume,
+			  img_i2c_runtime_suspend, img_i2c_runtime_resume,
+			  NULL);
 
 static const struct of_device_id img_scb_i2c_match[] = {
 	{ .compatible = "img,scb-i2c" },
@@ -1501,7 +1496,7 @@ static struct platform_driver img_scb_i2c_driver = {
 	.driver = {
 		.name		= "img-i2c-scb",
 		.of_match_table	= img_scb_i2c_match,
-		.pm		= &img_i2c_pm,
+		.pm		= pm_ptr(&img_i2c_pm),
 	},
 	.probe = img_i2c_probe,
 	.remove_new = img_i2c_remove,
-- 
2.40.1


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

* [PATCH 11/23] i2c: kempld: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (9 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 10/23] i2c: img-scb: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:37   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 12/23] i2c: lpc2k: " Paul Cercueil
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Paul Cercueil

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that the driver should most likely be updated to use the
platform_driver.driver.pm.{suspend,resume} callbacks.

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

diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
index 281058e3ea46..cb61e7b9202c 100644
--- a/drivers/i2c/busses/i2c-kempld.c
+++ b/drivers/i2c/busses/i2c-kempld.c
@@ -350,7 +350,6 @@ static void kempld_i2c_remove(struct platform_device *pdev)
 	i2c_del_adapter(&i2c->adap);
 }
 
-#ifdef CONFIG_PM
 static int kempld_i2c_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	struct kempld_i2c_data *i2c = platform_get_drvdata(pdev);
@@ -377,10 +376,6 @@ static int kempld_i2c_resume(struct platform_device *pdev)
 
 	return 0;
 }
-#else
-#define kempld_i2c_suspend	NULL
-#define kempld_i2c_resume	NULL
-#endif
 
 static struct platform_driver kempld_i2c_driver = {
 	.driver = {
@@ -388,8 +383,8 @@ static struct platform_driver kempld_i2c_driver = {
 	},
 	.probe		= kempld_i2c_probe,
 	.remove_new	= kempld_i2c_remove,
-	.suspend	= kempld_i2c_suspend,
-	.resume		= kempld_i2c_resume,
+	.suspend	= pm_ptr(kempld_i2c_suspend),
+	.resume		= pm_ptr(kempld_i2c_resume),
 };
 
 module_platform_driver(kempld_i2c_driver);
-- 
2.40.1


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

* [PATCH 12/23] i2c: lpc2k: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (10 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 11/23] i2c: kempld: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:39   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 13/23] i2c: mt65xx: " Paul Cercueil
                   ` (6 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Vladimir Zapolskiy,
	linux-arm-kernel

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that the behaviour is slightly different than before; the original
code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
resulted in these functions being compiled in but never used when
CONFIG_PM_SLEEP was disabled.

Now, those functions are only compiled in when CONFIG_PM_SLEEP is
enabled.

Also note that pm_sleep_ptr() has not been applied to each callback
in the dev_pm_ops structure because the pm_sleep_ptr() at the usage site
is sufficient.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/i2c/busses/i2c-lpc2k.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-lpc2k.c b/drivers/i2c/busses/i2c-lpc2k.c
index 5c6d96554753..c61157f1409b 100644
--- a/drivers/i2c/busses/i2c-lpc2k.c
+++ b/drivers/i2c/busses/i2c-lpc2k.c
@@ -431,7 +431,6 @@ static void i2c_lpc2k_remove(struct platform_device *dev)
 	i2c_del_adapter(&i2c->adap);
 }
 
-#ifdef CONFIG_PM
 static int i2c_lpc2k_suspend(struct device *dev)
 {
 	struct lpc2k_i2c *i2c = dev_get_drvdata(dev);
@@ -456,11 +455,6 @@ static const struct dev_pm_ops i2c_lpc2k_dev_pm_ops = {
 	.resume_noirq = i2c_lpc2k_resume,
 };
 
-#define I2C_LPC2K_DEV_PM_OPS (&i2c_lpc2k_dev_pm_ops)
-#else
-#define I2C_LPC2K_DEV_PM_OPS NULL
-#endif
-
 static const struct of_device_id lpc2k_i2c_match[] = {
 	{ .compatible = "nxp,lpc1788-i2c" },
 	{},
@@ -472,7 +466,7 @@ static struct platform_driver i2c_lpc2k_driver = {
 	.remove_new = i2c_lpc2k_remove,
 	.driver	= {
 		.name		= "lpc2k-i2c",
-		.pm		= I2C_LPC2K_DEV_PM_OPS,
+		.pm		= pm_sleep_ptr(&i2c_lpc2k_dev_pm_ops),
 		.of_match_table	= lpc2k_i2c_match,
 	},
 };
-- 
2.40.1


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

* [PATCH 13/23] i2c: mt65xx: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (11 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 12/23] i2c: lpc2k: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:40   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 14/23] i2c: nomadik: " Paul Cercueil
                   ` (5 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Qii Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-arm-kernel,
	linux-mediatek

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Qii Wang <qii.wang@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
---
 drivers/i2c/busses/i2c-mt65xx.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index 7ca3f2221ba6..21cc39e35cf6 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -1514,7 +1514,6 @@ static void mtk_i2c_remove(struct platform_device *pdev)
 	clk_bulk_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mtk_i2c_suspend_noirq(struct device *dev)
 {
 	struct mtk_i2c *i2c = dev_get_drvdata(dev);
@@ -1544,11 +1543,10 @@ static int mtk_i2c_resume_noirq(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops mtk_i2c_pm = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq,
-				      mtk_i2c_resume_noirq)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq,
+				  mtk_i2c_resume_noirq)
 };
 
 static struct platform_driver mtk_i2c_driver = {
@@ -1556,7 +1554,7 @@ static struct platform_driver mtk_i2c_driver = {
 	.remove_new = mtk_i2c_remove,
 	.driver = {
 		.name = I2C_DRV_NAME,
-		.pm = &mtk_i2c_pm,
+		.pm = pm_sleep_ptr(&mtk_i2c_pm),
 		.of_match_table = mtk_i2c_of_match,
 	},
 };
-- 
2.40.1


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

* [PATCH 14/23] i2c: nomadik: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (12 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 13/23] i2c: mt65xx: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:41   ` Jonathan Cameron
  2023-07-06 17:12   ` Linus Walleij
  2023-07-05 20:43 ` [PATCH 15/23] i2c: ocores: " Paul Cercueil
                   ` (4 subsequent siblings)
  18 siblings, 2 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Linus Walleij,
	linux-arm-kernel

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/i2c/busses/i2c-nomadik.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 1e5fd23ef45c..4a4b5bc257ae 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -873,7 +873,6 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int nmk_i2c_suspend_late(struct device *dev)
 {
 	int ret;
@@ -890,9 +889,7 @@ static int nmk_i2c_resume_early(struct device *dev)
 {
 	return pm_runtime_force_resume(dev);
 }
-#endif
 
-#ifdef CONFIG_PM
 static int nmk_i2c_runtime_suspend(struct device *dev)
 {
 	struct amba_device *adev = to_amba_device(dev);
@@ -925,13 +922,12 @@ static int nmk_i2c_runtime_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops nmk_i2c_pm = {
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
-	SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
-			nmk_i2c_runtime_resume,
-			NULL)
+	LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
+	RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
+		       nmk_i2c_runtime_resume,
+		       NULL)
 };
 
 static unsigned int nmk_i2c_functionality(struct i2c_adapter *adap)
@@ -1080,7 +1076,7 @@ static struct amba_driver nmk_i2c_driver = {
 	.drv = {
 		.owner = THIS_MODULE,
 		.name = DRIVER_NAME,
-		.pm = &nmk_i2c_pm,
+		.pm = pm_ptr(&nmk_i2c_pm),
 	},
 	.id_table = nmk_i2c_ids,
 	.probe = nmk_i2c_probe,
-- 
2.40.1


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

* [PATCH 15/23] i2c: ocores: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (13 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 14/23] i2c: nomadik: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:42   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 16/23] i2c: pnx: " Paul Cercueil
                   ` (3 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Peter Korsgaard,
	Andrew Lunn

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Andrew Lunn <andrew@lunn.ch>
---
 drivers/i2c/busses/i2c-ocores.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 4ac77e57bbbf..041a76f71a49 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -743,7 +743,6 @@ static void ocores_i2c_remove(struct platform_device *pdev)
 	i2c_del_adapter(&i2c->adap);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int ocores_i2c_suspend(struct device *dev)
 {
 	struct ocores_i2c *i2c = dev_get_drvdata(dev);
@@ -772,11 +771,8 @@ static int ocores_i2c_resume(struct device *dev)
 	return ocores_init(dev, i2c);
 }
 
-static SIMPLE_DEV_PM_OPS(ocores_i2c_pm, ocores_i2c_suspend, ocores_i2c_resume);
-#define OCORES_I2C_PM	(&ocores_i2c_pm)
-#else
-#define OCORES_I2C_PM	NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(ocores_i2c_pm,
+				ocores_i2c_suspend, ocores_i2c_resume);
 
 static struct platform_driver ocores_i2c_driver = {
 	.probe   = ocores_i2c_probe,
@@ -784,7 +780,7 @@ static struct platform_driver ocores_i2c_driver = {
 	.driver  = {
 		.name = "ocores-i2c",
 		.of_match_table = ocores_i2c_match,
-		.pm = OCORES_I2C_PM,
+		.pm = pm_sleep_ptr(&ocores_i2c_pm),
 	},
 };
 
-- 
2.40.1


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

* [PATCH 16/23] i2c: pnx: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (14 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 15/23] i2c: ocores: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:49   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 17/23] i2c: pxa: " Paul Cercueil
                   ` (2 subsequent siblings)
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Vladimir Zapolskiy,
	linux-arm-kernel

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/i2c/busses/i2c-pnx.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 82400057f810..4ee7db512333 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -613,7 +613,6 @@ static const struct i2c_algorithm pnx_algorithm = {
 	.functionality = i2c_pnx_func,
 };
 
-#ifdef CONFIG_PM_SLEEP
 static int i2c_pnx_controller_suspend(struct device *dev)
 {
 	struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev);
@@ -630,12 +629,9 @@ static int i2c_pnx_controller_resume(struct device *dev)
 	return clk_prepare_enable(alg_data->clk);
 }
 
-static SIMPLE_DEV_PM_OPS(i2c_pnx_pm,
-			 i2c_pnx_controller_suspend, i2c_pnx_controller_resume);
-#define PNX_I2C_PM	(&i2c_pnx_pm)
-#else
-#define PNX_I2C_PM	NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(i2c_pnx_pm,
+				i2c_pnx_controller_suspend,
+				i2c_pnx_controller_resume);
 
 static int i2c_pnx_probe(struct platform_device *pdev)
 {
@@ -763,7 +759,7 @@ static struct platform_driver i2c_pnx_driver = {
 	.driver = {
 		.name = "pnx-i2c",
 		.of_match_table = of_match_ptr(i2c_pnx_of_match),
-		.pm = PNX_I2C_PM,
+		.pm = pm_sleep_ptr(&i2c_pnx_pm),
 	},
 	.probe = i2c_pnx_probe,
 	.remove_new = i2c_pnx_remove,
-- 
2.40.1


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

* [PATCH 17/23] i2c: pxa: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (15 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 16/23] i2c: pnx: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:50   ` Jonathan Cameron
  2023-07-05 20:43 ` [PATCH 18/23] i2c: qup: " Paul Cercueil
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Paul Cercueil

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that the behaviour is slightly different than before; the original
code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
resulted in these functions being compiled in but never used when
CONFIG_PM_SLEEP was disabled.

Now, those functions are only compiled in when CONFIG_PM_SLEEP is
enabled.

Also note that pm_sleep_ptr() has not been applied to each callback
in the dev_pm_ops structure because the pm_sleep_ptr() at the usage site
is sufficient.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/i2c/busses/i2c-pxa.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 937f7eebe906..65a18d73be5c 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1491,7 +1491,6 @@ static void i2c_pxa_remove(struct platform_device *dev)
 	clk_disable_unprepare(i2c->clk);
 }
 
-#ifdef CONFIG_PM
 static int i2c_pxa_suspend_noirq(struct device *dev)
 {
 	struct pxa_i2c *i2c = dev_get_drvdata(dev);
@@ -1516,17 +1515,12 @@ static const struct dev_pm_ops i2c_pxa_dev_pm_ops = {
 	.resume_noirq = i2c_pxa_resume_noirq,
 };
 
-#define I2C_PXA_DEV_PM_OPS (&i2c_pxa_dev_pm_ops)
-#else
-#define I2C_PXA_DEV_PM_OPS NULL
-#endif
-
 static struct platform_driver i2c_pxa_driver = {
 	.probe		= i2c_pxa_probe,
 	.remove_new	= i2c_pxa_remove,
 	.driver		= {
 		.name	= "pxa2xx-i2c",
-		.pm	= I2C_PXA_DEV_PM_OPS,
+		.pm	= pm_sleep_ptr(&i2c_pxa_dev_pm_ops),
 		.of_match_table = i2c_pxa_dt_ids,
 	},
 	.id_table	= i2c_pxa_id_table,
-- 
2.40.1


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

* [PATCH 18/23] i2c: qup: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (16 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 17/23] i2c: pxa: " Paul Cercueil
@ 2023-07-05 20:43 ` Paul Cercueil
  2023-07-06  2:51   ` Jonathan Cameron
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
  18 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:43 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Note that the driver should probably use the DEFINE_RUNTIME_DEV_PM_OPS()
macro, as the system suspend/resume callbacks seem to not do anything
more than triggering the runtime-PM states.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: linux-arm-msm@vger.kernel.org
---
 drivers/i2c/busses/i2c-qup.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 6eef1dbd00de..658d1c1c2ec8 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1920,7 +1920,6 @@ static void qup_i2c_remove(struct platform_device *pdev)
 	pm_runtime_set_suspended(qup->dev);
 }
 
-#ifdef CONFIG_PM
 static int qup_i2c_pm_suspend_runtime(struct device *device)
 {
 	struct qup_i2c_dev *qup = dev_get_drvdata(device);
@@ -1938,9 +1937,7 @@ static int qup_i2c_pm_resume_runtime(struct device *device)
 	qup_i2c_enable_clocks(qup);
 	return 0;
 }
-#endif
 
-#ifdef CONFIG_PM_SLEEP
 static int qup_i2c_suspend(struct device *device)
 {
 	if (!pm_runtime_suspended(device))
@@ -1955,16 +1952,11 @@ static int qup_i2c_resume(struct device *device)
 	pm_request_autosuspend(device);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops qup_i2c_qup_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(
-		qup_i2c_suspend,
-		qup_i2c_resume)
-	SET_RUNTIME_PM_OPS(
-		qup_i2c_pm_suspend_runtime,
-		qup_i2c_pm_resume_runtime,
-		NULL)
+	SYSTEM_SLEEP_PM_OPS(qup_i2c_suspend, qup_i2c_resume)
+	RUNTIME_PM_OPS(qup_i2c_pm_suspend_runtime,
+		       qup_i2c_pm_resume_runtime, NULL)
 };
 
 static const struct of_device_id qup_i2c_dt_match[] = {
@@ -1980,7 +1972,7 @@ static struct platform_driver qup_i2c_driver = {
 	.remove_new = qup_i2c_remove,
 	.driver = {
 		.name = "i2c_qup",
-		.pm = &qup_i2c_qup_pm_ops,
+		.pm = pm_ptr(&qup_i2c_qup_pm_ops),
 		.of_match_table = qup_i2c_dt_match,
 		.acpi_match_table = ACPI_PTR(qup_i2c_acpi_match),
 	},
-- 
2.40.1


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

* [PATCH 19/23] i2c: rcar: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
                   ` (17 preceding siblings ...)
  2023-07-05 20:43 ` [PATCH 18/23] i2c: qup: " Paul Cercueil
@ 2023-07-05 20:45 ` Paul Cercueil
  2023-07-05 20:45   ` [PATCH 20/23] i2c: s3c2410: " Paul Cercueil
                     ` (5 more replies)
  18 siblings, 6 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:45 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Wolfram Sang,
	linux-renesas-soc

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org
---
 drivers/i2c/busses/i2c-rcar.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 2d9c37410ebd..6b7f0f27d0c3 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -1169,7 +1169,6 @@ static void rcar_i2c_remove(struct platform_device *pdev)
 	pm_runtime_disable(dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int rcar_i2c_suspend(struct device *dev)
 {
 	struct rcar_i2c_priv *priv = dev_get_drvdata(dev);
@@ -1187,19 +1186,14 @@ static int rcar_i2c_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops rcar_i2c_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(rcar_i2c_suspend, rcar_i2c_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(rcar_i2c_suspend, rcar_i2c_resume)
 };
 
-#define DEV_PM_OPS (&rcar_i2c_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
-
 static struct platform_driver rcar_i2c_driver = {
 	.driver	= {
 		.name	= "i2c-rcar",
 		.of_match_table = rcar_i2c_dt_ids,
-		.pm	= DEV_PM_OPS,
+		.pm	= pm_sleep_ptr(&rcar_i2c_pm_ops),
 	},
 	.probe		= rcar_i2c_probe,
 	.remove_new	= rcar_i2c_remove,
-- 
2.40.1


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

* [PATCH 20/23] i2c: s3c2410: Remove #ifdef guards for PM related functions
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
@ 2023-07-05 20:45   ` Paul Cercueil
  2023-07-06  3:06     ` Jonathan Cameron
  2023-07-05 20:45   ` [PATCH 21/23] i2c: sh-mobile: " Paul Cercueil
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:45 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Krzysztof Kozlowski,
	Alim Akhtar, linux-arm-kernel, linux-samsung-soc

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
---
 drivers/i2c/busses/i2c-s3c2410.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 28f0e5c64f32..d23a9e7fcb48 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1125,7 +1125,6 @@ static void s3c24xx_i2c_remove(struct platform_device *pdev)
 	i2c_del_adapter(&i2c->adap);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int s3c24xx_i2c_suspend_noirq(struct device *dev)
 {
 	struct s3c24xx_i2c *i2c = dev_get_drvdata(dev);
@@ -1155,26 +1154,19 @@ static int s3c24xx_i2c_resume_noirq(struct device *dev)
 
 	return 0;
 }
-#endif
 
-#ifdef CONFIG_PM
 static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(s3c24xx_i2c_suspend_noirq,
-				      s3c24xx_i2c_resume_noirq)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(s3c24xx_i2c_suspend_noirq,
+				  s3c24xx_i2c_resume_noirq)
 };
 
-#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
-#else
-#define S3C24XX_DEV_PM_OPS NULL
-#endif
-
 static struct platform_driver s3c24xx_i2c_driver = {
 	.probe		= s3c24xx_i2c_probe,
 	.remove_new	= s3c24xx_i2c_remove,
 	.id_table	= s3c24xx_driver_ids,
 	.driver		= {
 		.name	= "s3c-i2c",
-		.pm	= S3C24XX_DEV_PM_OPS,
+		.pm	= pm_sleep_ptr(&s3c24xx_i2c_dev_pm_ops),
 		.of_match_table = of_match_ptr(s3c24xx_i2c_match),
 	},
 };
-- 
2.40.1


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

* [PATCH 21/23] i2c: sh-mobile: Remove #ifdef guards for PM related functions
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
  2023-07-05 20:45   ` [PATCH 20/23] i2c: s3c2410: " Paul Cercueil
@ 2023-07-05 20:45   ` Paul Cercueil
  2023-07-06  3:07     ` Jonathan Cameron
  2023-07-10 12:40     ` Geert Uytterhoeven
  2023-07-05 20:45   ` [PATCH 22/23] i2c: virtio: " Paul Cercueil
                     ` (3 subsequent siblings)
  5 siblings, 2 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:45 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Wolfram Sang,
	linux-renesas-soc

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org
---
 drivers/i2c/busses/i2c-sh_mobile.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 21717b943a9e..324407196a10 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -965,7 +965,6 @@ static void sh_mobile_i2c_remove(struct platform_device *dev)
 	pm_runtime_disable(&dev->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sh_mobile_i2c_suspend(struct device *dev)
 {
 	struct sh_mobile_i2c_data *pd = dev_get_drvdata(dev);
@@ -983,20 +982,15 @@ static int sh_mobile_i2c_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops sh_mobile_i2c_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_mobile_i2c_suspend,
-				      sh_mobile_i2c_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_mobile_i2c_suspend,
+				  sh_mobile_i2c_resume)
 };
 
-#define DEV_PM_OPS (&sh_mobile_i2c_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
-
 static struct platform_driver sh_mobile_i2c_driver = {
 	.driver		= {
 		.name		= "i2c-sh_mobile",
 		.of_match_table = sh_mobile_i2c_dt_ids,
-		.pm	= DEV_PM_OPS,
+		.pm	= pm_sleep_ptr(&sh_mobile_i2c_pm_ops),
 	},
 	.probe		= sh_mobile_i2c_probe,
 	.remove_new	= sh_mobile_i2c_remove,
-- 
2.40.1


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

* [PATCH 22/23] i2c: virtio: Remove #ifdef guards for PM related functions
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
  2023-07-05 20:45   ` [PATCH 20/23] i2c: s3c2410: " Paul Cercueil
  2023-07-05 20:45   ` [PATCH 21/23] i2c: sh-mobile: " Paul Cercueil
@ 2023-07-05 20:45   ` Paul Cercueil
  2023-07-06  3:07     ` Jonathan Cameron
  2023-07-06  4:27     ` Viresh Kumar
  2023-07-05 20:45   ` [PATCH 23/23] i2c: mux: pca954x: " Paul Cercueil
                     ` (2 subsequent siblings)
  5 siblings, 2 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:45 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-kernel, Paul Cercueil, Conghui Chen,
	Viresh Kumar, virtualization

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Conghui Chen <conghui.chen@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: virtualization@lists.linux-foundation.org
---
 drivers/i2c/busses/i2c-virtio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
index 4b9536f50800..c60ae531ba57 100644
--- a/drivers/i2c/busses/i2c-virtio.c
+++ b/drivers/i2c/busses/i2c-virtio.c
@@ -243,7 +243,6 @@ static struct virtio_device_id id_table[] = {
 };
 MODULE_DEVICE_TABLE(virtio, id_table);
 
-#ifdef CONFIG_PM_SLEEP
 static int virtio_i2c_freeze(struct virtio_device *vdev)
 {
 	virtio_i2c_del_vqs(vdev);
@@ -254,7 +253,6 @@ static int virtio_i2c_restore(struct virtio_device *vdev)
 {
 	return virtio_i2c_setup_vqs(vdev->priv);
 }
-#endif
 
 static const unsigned int features[] = {
 	VIRTIO_I2C_F_ZERO_LENGTH_REQUEST,
@@ -269,10 +267,8 @@ static struct virtio_driver virtio_i2c_driver = {
 	.driver			= {
 		.name	= "i2c_virtio",
 	},
-#ifdef CONFIG_PM_SLEEP
-	.freeze = virtio_i2c_freeze,
-	.restore = virtio_i2c_restore,
-#endif
+	.freeze			= pm_sleep_ptr(virtio_i2c_freeze),
+	.restore		= pm_sleep_ptr(virtio_i2c_restore),
 };
 module_virtio_driver(virtio_i2c_driver);
 
-- 
2.40.1


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

* [PATCH 23/23] i2c: mux: pca954x: Remove #ifdef guards for PM related functions
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
                     ` (2 preceding siblings ...)
  2023-07-05 20:45   ` [PATCH 22/23] i2c: virtio: " Paul Cercueil
@ 2023-07-05 20:45   ` Paul Cercueil
  2023-07-06  3:07     ` Jonathan Cameron
  2023-07-06  6:31     ` Peter Rosin
  2023-07-06  2:52   ` [PATCH 19/23] i2c: rcar: " Jonathan Cameron
  2023-07-10 12:41   ` Geert Uytterhoeven
  5 siblings, 2 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-05 20:45 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Paul Cercueil, Peter Rosin

Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

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.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>

---
Cc: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 0ccee2ae5720..6965bf4c2348 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -530,7 +530,6 @@ static void pca954x_remove(struct i2c_client *client)
 	pca954x_cleanup(muxc);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int pca954x_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -544,14 +543,13 @@ static int pca954x_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(pca954x_pm, NULL, pca954x_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pca954x_pm, NULL, pca954x_resume);
 
 static struct i2c_driver pca954x_driver = {
 	.driver		= {
 		.name	= "pca954x",
-		.pm	= &pca954x_pm,
+		.pm	= pm_sleep_ptr(&pca954x_pm),
 		.of_match_table = pca954x_of_match,
 	},
 	.probe		= pca954x_probe,
-- 
2.40.1


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

* Re: [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions Paul Cercueil
@ 2023-07-06  2:09   ` Jonathan Cameron
  2023-07-08  8:42     ` Paul Cercueil
  0 siblings, 1 reply; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:09 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Elie Morisse,
	Shyam Sundar S K

On Wed,  5 Jul 2023 22:42:52 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that the use of the UNIVERSAL_DEV_PM_OPS() macro was likely to be
> wrong, as it sets the same callbacks for the runtime-PM and system
> suspend/resume. This patch does not change this behaviour, but I suspect
> that it should be changed to use DEFINE_RUNTIME_DEV_PM_OPS() instead, as
> the current documentation for UNIVERSAL_DEV_PM_OPS() suggests.

I'd be tempted to leave this one alone because it'll be much harder
to spot that it's an ex UNIVERSAL_DEV_PM_OPS() that needs some thinking
about after this change.

> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
> ---
> Cc: Elie Morisse <syniurge@gmail.com>
> Cc: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
> ---
>  drivers/i2c/busses/i2c-amd-mp2-pci.c  | 14 +++++---------
>  drivers/i2c/busses/i2c-amd-mp2-plat.c |  8 ++------
>  drivers/i2c/busses/i2c-amd-mp2.h      |  2 --
>  3 files changed, 7 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c
> index 143165300949..114fe329279a 100644
> --- a/drivers/i2c/busses/i2c-amd-mp2-pci.c
> +++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c
> @@ -382,7 +382,6 @@ static void amd_mp2_pci_remove(struct pci_dev *pci_dev)
>  	amd_mp2_clear_reg(privdata);
>  }
>  
> -#ifdef CONFIG_PM
>  static int amd_mp2_pci_suspend(struct device *dev)
>  {
>  	struct pci_dev *pci_dev = to_pci_dev(dev);
> @@ -434,9 +433,10 @@ static int amd_mp2_pci_resume(struct device *dev)
>  	return ret;
>  }
>  
> -static UNIVERSAL_DEV_PM_OPS(amd_mp2_pci_pm_ops, amd_mp2_pci_suspend,
> -			    amd_mp2_pci_resume, NULL);
> -#endif /* CONFIG_PM */
> +static const struct dev_pm_ops amd_mp2_pci_pm_ops = {
> +	SYSTEM_SLEEP_PM_OPS(amd_mp2_pci_suspend, amd_mp2_pci_resume)
> +	RUNTIME_PM_OPS(amd_mp2_pci_suspend, amd_mp2_pci_resume, NULL)
> +};
>  
>  static const struct pci_device_id amd_mp2_pci_tbl[] = {
>  	{PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_MP2)},
> @@ -449,11 +449,7 @@ static struct pci_driver amd_mp2_pci_driver = {
>  	.id_table	= amd_mp2_pci_tbl,
>  	.probe		= amd_mp2_pci_probe,
>  	.remove		= amd_mp2_pci_remove,
> -#ifdef CONFIG_PM
> -	.driver = {
> -		.pm	= &amd_mp2_pci_pm_ops,
> -	},
> -#endif
> +	.driver.pm	= pm_ptr(&amd_mp2_pci_pm_ops),
>  };
>  module_pci_driver(amd_mp2_pci_driver);
>  
> diff --git a/drivers/i2c/busses/i2c-amd-mp2-plat.c b/drivers/i2c/busses/i2c-amd-mp2-plat.c
> index 112fe2bc5662..4c677aeaca29 100644
> --- a/drivers/i2c/busses/i2c-amd-mp2-plat.c
> +++ b/drivers/i2c/busses/i2c-amd-mp2-plat.c
> @@ -183,7 +183,6 @@ static const struct i2c_algorithm i2c_amd_algorithm = {
>  	.functionality = i2c_amd_func,
>  };
>  
> -#ifdef CONFIG_PM
>  static int i2c_amd_suspend(struct amd_i2c_common *i2c_common)
>  {
>  	struct amd_i2c_dev *i2c_dev = amd_i2c_dev_common(i2c_common);
> @@ -198,7 +197,6 @@ static int i2c_amd_resume(struct amd_i2c_common *i2c_common)
>  
>  	return i2c_amd_enable_set(i2c_dev, true);
>  }
> -#endif
>  
>  static const u32 supported_speeds[] = {
>  	I2C_MAX_HIGH_SPEED_MODE_FREQ,
> @@ -276,10 +274,8 @@ static int i2c_amd_probe(struct platform_device *pdev)
>  	platform_set_drvdata(pdev, i2c_dev);
>  
>  	i2c_dev->common.cmd_completion = &i2c_amd_cmd_completion;
> -#ifdef CONFIG_PM
> -	i2c_dev->common.suspend = &i2c_amd_suspend;
> -	i2c_dev->common.resume = &i2c_amd_resume;
> -#endif
> +	i2c_dev->common.suspend = pm_ptr(&i2c_amd_suspend);
> +	i2c_dev->common.resume = pm_ptr(&i2c_amd_resume);
>  
>  	/* Register the adapter */
>  	amd_mp2_pm_runtime_get(mp2_dev);
> diff --git a/drivers/i2c/busses/i2c-amd-mp2.h b/drivers/i2c/busses/i2c-amd-mp2.h
> index 018a42de8b1e..40f3cdcc60aa 100644
> --- a/drivers/i2c/busses/i2c-amd-mp2.h
> +++ b/drivers/i2c/busses/i2c-amd-mp2.h
> @@ -160,10 +160,8 @@ struct amd_i2c_common {
>  	enum speed_enum i2c_speed;
>  	u8 *dma_buf;
>  	dma_addr_t dma_addr;
> -#ifdef CONFIG_PM
>  	int (*suspend)(struct amd_i2c_common *i2c_common);
>  	int (*resume)(struct amd_i2c_common *i2c_common);
> -#endif /* CONFIG_PM */
>  };
>  
>  /**


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

* Re: [PATCH 02/23] i2c: au1550: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 02/23] i2c: au1550: " Paul Cercueil
@ 2023-07-06  2:10   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:10 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel

On Wed,  5 Jul 2023 22:42:53 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that the behaviour is slightly different than before; the original
> code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
> resulted in these functions being compiled in but never used when
> CONFIG_PM_SLEEP was disabled.
> 
> Now, those functions are only compiled in when CONFIG_PM_SLEEP is
> enabled.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/i2c/busses/i2c-au1550.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c
> index e66c12ecf270..8e43f25c117e 100644
> --- a/drivers/i2c/busses/i2c-au1550.c
> +++ b/drivers/i2c/busses/i2c-au1550.c
> @@ -342,7 +342,6 @@ static void i2c_au1550_remove(struct platform_device *pdev)
>  	i2c_au1550_disable(priv);
>  }
>  
> -#ifdef CONFIG_PM
>  static int i2c_au1550_suspend(struct device *dev)
>  {
>  	struct i2c_au1550_data *priv = dev_get_drvdata(dev);
> @@ -361,21 +360,13 @@ static int i2c_au1550_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static const struct dev_pm_ops i2c_au1550_pmops = {
> -	.suspend	= i2c_au1550_suspend,
> -	.resume		= i2c_au1550_resume,
> -};
> -
> -#define AU1XPSC_SMBUS_PMOPS (&i2c_au1550_pmops)
> -
> -#else
> -#define AU1XPSC_SMBUS_PMOPS NULL
> -#endif
> +static DEFINE_SIMPLE_DEV_PM_OPS(i2c_au1550_pmops,
> +				i2c_au1550_suspend, i2c_au1550_resume);
>  
>  static struct platform_driver au1xpsc_smbus_driver = {
>  	.driver = {
>  		.name	= "au1xpsc_smbus",
> -		.pm	= AU1XPSC_SMBUS_PMOPS,
> +		.pm	= pm_sleep_ptr(&i2c_au1550_pmops),
>  	},
>  	.probe		= i2c_au1550_probe,
>  	.remove_new	= i2c_au1550_remove,


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

* Re: [PATCH 03/23] i2c: iproc: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 03/23] i2c: iproc: " Paul Cercueil
@ 2023-07-06  2:11   ` Jonathan Cameron
  2023-07-06 17:01   ` Ray Jui
  1 sibling, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:11 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-arm-kernel

On Wed,  5 Jul 2023 22:42:54 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

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

* Re: [PATCH 04/23] i2c: brcmstb: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 04/23] i2c: brcmstb: " Paul Cercueil
@ 2023-07-06  2:12   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:12 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Kamal Dasu,
	Broadcom internal kernel review list, Florian Fainelli,
	linux-arm-kernel

On Wed,  5 Jul 2023 22:42:55 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 05/23] i2c: davinci: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 05/23] i2c: davinci: " Paul Cercueil
@ 2023-07-06  2:15   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:15 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Bartosz Golaszewski,
	linux-arm-kernel

On Wed,  5 Jul 2023 22:42:56 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that the behaviour is slightly different than before; the original
> code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
> resulted in these functions being compiled in but never used when
> CONFIG_PM_SLEEP was disabled.
> 
> Now, those functions are only compiled in when CONFIG_PM_SLEEP is
> enabled.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Slightly odd combination of callbacks in this driver, but your change
looks good to me.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 06/23] i2c: designware: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 06/23] i2c: designware: " Paul Cercueil
@ 2023-07-06  2:18   ` Jonathan Cameron
  2023-07-06  9:11   ` Andy Shevchenko
  1 sibling, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:18 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Jarkko Nikula,
	Andy Shevchenko, Mika Westerberg, Jan Dabros

On Wed,  5 Jul 2023 22:42:57 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
LGTM
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 07/23] i2c: exynos5: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 07/23] i2c: exynos5: " Paul Cercueil
@ 2023-07-06  2:25   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:25 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Krzysztof Kozlowski,
	Alim Akhtar, linux-arm-kernel, linux-samsung-soc

On Wed,  5 Jul 2023 22:42:58 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


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

* Re: [PATCH 08/23] i2c: hix5hd2: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 08/23] i2c: hix5hd2: " Paul Cercueil
@ 2023-07-06  2:27   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:27 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel

On Wed,  5 Jul 2023 22:42:59 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that this driver should probably use the
> DEFINE_RUNTIME_DEV_PM_OPS() macro, which would allow the devices to be
> runtime-suspended on system suspend.
Agreed - if anyone can test that good to do it as a follow up
as it's a functional change.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


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

* Re: [PATCH 09/23] i2c: i801: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 09/23] i2c: i801: " Paul Cercueil
@ 2023-07-06  2:28   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:28 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel, Jean Delvare

On Wed,  5 Jul 2023 22:43:00 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


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

* Re: [PATCH 10/23] i2c: img-scb: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 10/23] i2c: img-scb: " Paul Cercueil
@ 2023-07-06  2:31   ` Jonathan Cameron
  2023-07-08  8:46     ` Paul Cercueil
  0 siblings, 1 reply; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:31 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel

On Wed,  5 Jul 2023 22:43:01 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
I thought the _DEFINE macros weren't really intended for driver
usage and it's good to keep the ability to change those details
without updating lots of drivers.  Perhaps just express it long hand here?

Jonathan


> ---
>  drivers/i2c/busses/i2c-img-scb.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c
> index 4b674cfbc6fb..a92e3082542e 100644
> --- a/drivers/i2c/busses/i2c-img-scb.c
> +++ b/drivers/i2c/busses/i2c-img-scb.c
> @@ -1454,7 +1454,6 @@ static int img_i2c_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int img_i2c_suspend(struct device *dev)
>  {
>  	struct img_i2c *i2c = dev_get_drvdata(dev);
> @@ -1482,14 +1481,10 @@ static int img_i2c_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif /* CONFIG_PM_SLEEP */
>  
> -static const struct dev_pm_ops img_i2c_pm = {
> -	SET_RUNTIME_PM_OPS(img_i2c_runtime_suspend,
> -			   img_i2c_runtime_resume,
> -			   NULL)
> -	SET_SYSTEM_SLEEP_PM_OPS(img_i2c_suspend, img_i2c_resume)
> -};
> +static _DEFINE_DEV_PM_OPS(img_i2c_pm, img_i2c_suspend, img_i2c_resume,
> +			  img_i2c_runtime_suspend, img_i2c_runtime_resume,
> +			  NULL);
>  
>  static const struct of_device_id img_scb_i2c_match[] = {
>  	{ .compatible = "img,scb-i2c" },
> @@ -1501,7 +1496,7 @@ static struct platform_driver img_scb_i2c_driver = {
>  	.driver = {
>  		.name		= "img-i2c-scb",
>  		.of_match_table	= img_scb_i2c_match,
> -		.pm		= &img_i2c_pm,
> +		.pm		= pm_ptr(&img_i2c_pm),
>  	},
>  	.probe = img_i2c_probe,
>  	.remove_new = img_i2c_remove,


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

* Re: [PATCH 11/23] i2c: kempld: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 11/23] i2c: kempld: " Paul Cercueil
@ 2023-07-06  2:37   ` Jonathan Cameron
  2023-07-08  9:13     ` Paul Cercueil
  0 siblings, 1 reply; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:37 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel

On Wed,  5 Jul 2023 22:43:02 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that the driver should most likely be updated to use the
> platform_driver.driver.pm.{suspend,resume} callbacks.

Agreed.  In this particular case I'd be tempted to do that first
so that we don't introduce pm_ptr() usage for these hooks.
Look at the platform device core, I suspect they should be pm_sleep_ptr()
but not 100% sure.

Jonathan

> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
>  drivers/i2c/busses/i2c-kempld.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
> index 281058e3ea46..cb61e7b9202c 100644
> --- a/drivers/i2c/busses/i2c-kempld.c
> +++ b/drivers/i2c/busses/i2c-kempld.c
> @@ -350,7 +350,6 @@ static void kempld_i2c_remove(struct platform_device *pdev)
>  	i2c_del_adapter(&i2c->adap);
>  }
>  
> -#ifdef CONFIG_PM
>  static int kempld_i2c_suspend(struct platform_device *pdev, pm_message_t state)
>  {
>  	struct kempld_i2c_data *i2c = platform_get_drvdata(pdev);
> @@ -377,10 +376,6 @@ static int kempld_i2c_resume(struct platform_device *pdev)
>  
>  	return 0;
>  }
> -#else
> -#define kempld_i2c_suspend	NULL
> -#define kempld_i2c_resume	NULL
> -#endif
>  
>  static struct platform_driver kempld_i2c_driver = {
>  	.driver = {
> @@ -388,8 +383,8 @@ static struct platform_driver kempld_i2c_driver = {
>  	},
>  	.probe		= kempld_i2c_probe,
>  	.remove_new	= kempld_i2c_remove,
> -	.suspend	= kempld_i2c_suspend,
> -	.resume		= kempld_i2c_resume,
> +	.suspend	= pm_ptr(kempld_i2c_suspend),
> +	.resume		= pm_ptr(kempld_i2c_resume),
>  };
>  
>  module_platform_driver(kempld_i2c_driver);


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

* Re: [PATCH 12/23] i2c: lpc2k: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 12/23] i2c: lpc2k: " Paul Cercueil
@ 2023-07-06  2:39   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:39 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Vladimir Zapolskiy,
	linux-arm-kernel

On Wed,  5 Jul 2023 22:43:03 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that the behaviour is slightly different than before; the original
> code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
> resulted in these functions being compiled in but never used when
> CONFIG_PM_SLEEP was disabled.
> 
> Now, those functions are only compiled in when CONFIG_PM_SLEEP is
> enabled.
> 
> Also note that pm_sleep_ptr() has not been applied to each callback
> in the dev_pm_ops structure because the pm_sleep_ptr() at the usage site
> is sufficient.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 13/23] i2c: mt65xx: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 13/23] i2c: mt65xx: " Paul Cercueil
@ 2023-07-06  2:40   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:40 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Qii Wang, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek

On Wed,  5 Jul 2023 22:43:04 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 14/23] i2c: nomadik: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 14/23] i2c: nomadik: " Paul Cercueil
@ 2023-07-06  2:41   ` Jonathan Cameron
  2023-07-06 17:12   ` Linus Walleij
  1 sibling, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:41 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Linus Walleij,
	linux-arm-kernel

On Wed,  5 Jul 2023 22:43:05 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
Might be worth rewrapping the runtime pm line. Otherwise LGTM

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  drivers/i2c/busses/i2c-nomadik.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
> index 1e5fd23ef45c..4a4b5bc257ae 100644
> --- a/drivers/i2c/busses/i2c-nomadik.c
> +++ b/drivers/i2c/busses/i2c-nomadik.c
> @@ -873,7 +873,6 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
>  	return IRQ_HANDLED;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int nmk_i2c_suspend_late(struct device *dev)
>  {
>  	int ret;
> @@ -890,9 +889,7 @@ static int nmk_i2c_resume_early(struct device *dev)
>  {
>  	return pm_runtime_force_resume(dev);
>  }
> -#endif
>  
> -#ifdef CONFIG_PM
>  static int nmk_i2c_runtime_suspend(struct device *dev)
>  {
>  	struct amba_device *adev = to_amba_device(dev);
> @@ -925,13 +922,12 @@ static int nmk_i2c_runtime_resume(struct device *dev)
>  
>  	return ret;
>  }
> -#endif
>  
>  static const struct dev_pm_ops nmk_i2c_pm = {
> -	SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
> -	SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
> -			nmk_i2c_runtime_resume,
> -			NULL)
> +	LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
> +	RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
> +		       nmk_i2c_runtime_resume,
> +		       NULL)

rewrap?

>  };
>  
>  static unsigned int nmk_i2c_functionality(struct i2c_adapter *adap)
> @@ -1080,7 +1076,7 @@ static struct amba_driver nmk_i2c_driver = {
>  	.drv = {
>  		.owner = THIS_MODULE,
>  		.name = DRIVER_NAME,
> -		.pm = &nmk_i2c_pm,
> +		.pm = pm_ptr(&nmk_i2c_pm),
>  	},
>  	.id_table = nmk_i2c_ids,
>  	.probe = nmk_i2c_probe,


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

* Re: [PATCH 15/23] i2c: ocores: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 15/23] i2c: ocores: " Paul Cercueil
@ 2023-07-06  2:42   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:42 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Peter Korsgaard,
	Andrew Lunn

On Wed,  5 Jul 2023 22:43:06 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 16/23] i2c: pnx: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 16/23] i2c: pnx: " Paul Cercueil
@ 2023-07-06  2:49   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:49 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Vladimir Zapolskiy,
	linux-arm-kernel

On Wed,  5 Jul 2023 22:43:07 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 17/23] i2c: pxa: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 17/23] i2c: pxa: " Paul Cercueil
@ 2023-07-06  2:50   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:50 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel

On Wed,  5 Jul 2023 22:43:08 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that the behaviour is slightly different than before; the original
> code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which
> resulted in these functions being compiled in but never used when
> CONFIG_PM_SLEEP was disabled.
> 
> Now, those functions are only compiled in when CONFIG_PM_SLEEP is
> enabled.
> 
> Also note that pm_sleep_ptr() has not been applied to each callback
> in the dev_pm_ops structure because the pm_sleep_ptr() at the usage site
> is sufficient.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


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

* Re: [PATCH 18/23] i2c: qup: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 18/23] i2c: qup: " Paul Cercueil
@ 2023-07-06  2:51   ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:51 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm

On Wed,  5 Jul 2023 22:43:09 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Note that the driver should probably use the DEFINE_RUNTIME_DEV_PM_OPS()
> macro, as the system suspend/resume callbacks seem to not do anything
> more than triggering the runtime-PM states.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 19/23] i2c: rcar: Remove #ifdef guards for PM related functions
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
                     ` (3 preceding siblings ...)
  2023-07-05 20:45   ` [PATCH 23/23] i2c: mux: pca954x: " Paul Cercueil
@ 2023-07-06  2:52   ` Jonathan Cameron
  2023-07-10 12:41   ` Geert Uytterhoeven
  5 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  2:52 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Wolfram Sang,
	linux-renesas-soc

On Wed,  5 Jul 2023 22:45:17 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 20/23] i2c: s3c2410: Remove #ifdef guards for PM related functions
  2023-07-05 20:45   ` [PATCH 20/23] i2c: s3c2410: " Paul Cercueil
@ 2023-07-06  3:06     ` Jonathan Cameron
  0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  3:06 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Krzysztof Kozlowski,
	Alim Akhtar, linux-arm-kernel, linux-samsung-soc

On Wed,  5 Jul 2023 22:45:18 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 21/23] i2c: sh-mobile: Remove #ifdef guards for PM related functions
  2023-07-05 20:45   ` [PATCH 21/23] i2c: sh-mobile: " Paul Cercueil
@ 2023-07-06  3:07     ` Jonathan Cameron
  2023-07-10 12:40     ` Geert Uytterhoeven
  1 sibling, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  3:07 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Wolfram Sang,
	linux-renesas-soc

On Wed,  5 Jul 2023 22:45:19 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


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

* Re: [PATCH 22/23] i2c: virtio: Remove #ifdef guards for PM related functions
  2023-07-05 20:45   ` [PATCH 22/23] i2c: virtio: " Paul Cercueil
@ 2023-07-06  3:07     ` Jonathan Cameron
  2023-07-06  4:27     ` Viresh Kumar
  1 sibling, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  3:07 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Conghui Chen, Viresh Kumar,
	virtualization

On Wed,  5 Jul 2023 22:45:20 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 23/23] i2c: mux: pca954x: Remove #ifdef guards for PM related functions
  2023-07-05 20:45   ` [PATCH 23/23] i2c: mux: pca954x: " Paul Cercueil
@ 2023-07-06  3:07     ` Jonathan Cameron
  2023-07-06  6:31     ` Peter Rosin
  1 sibling, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2023-07-06  3:07 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel, Peter Rosin

On Wed,  5 Jul 2023 22:45:21 +0200
Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

* Re: [PATCH 22/23] i2c: virtio: Remove #ifdef guards for PM related functions
  2023-07-05 20:45   ` [PATCH 22/23] i2c: virtio: " Paul Cercueil
  2023-07-06  3:07     ` Jonathan Cameron
@ 2023-07-06  4:27     ` Viresh Kumar
  1 sibling, 0 replies; 57+ messages in thread
From: Viresh Kumar @ 2023-07-06  4:27 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Conghui Chen,
	virtualization

On 05-07-23, 22:45, Paul Cercueil wrote:
> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
> ---
> Cc: Conghui Chen <conghui.chen@intel.com>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: virtualization@lists.linux-foundation.org
> ---
>  drivers/i2c/busses/i2c-virtio.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
> index 4b9536f50800..c60ae531ba57 100644
> --- a/drivers/i2c/busses/i2c-virtio.c
> +++ b/drivers/i2c/busses/i2c-virtio.c
> @@ -243,7 +243,6 @@ static struct virtio_device_id id_table[] = {
>  };
>  MODULE_DEVICE_TABLE(virtio, id_table);
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int virtio_i2c_freeze(struct virtio_device *vdev)
>  {
>  	virtio_i2c_del_vqs(vdev);
> @@ -254,7 +253,6 @@ static int virtio_i2c_restore(struct virtio_device *vdev)
>  {
>  	return virtio_i2c_setup_vqs(vdev->priv);
>  }
> -#endif
>  
>  static const unsigned int features[] = {
>  	VIRTIO_I2C_F_ZERO_LENGTH_REQUEST,
> @@ -269,10 +267,8 @@ static struct virtio_driver virtio_i2c_driver = {
>  	.driver			= {
>  		.name	= "i2c_virtio",
>  	},
> -#ifdef CONFIG_PM_SLEEP
> -	.freeze = virtio_i2c_freeze,
> -	.restore = virtio_i2c_restore,
> -#endif
> +	.freeze			= pm_sleep_ptr(virtio_i2c_freeze),
> +	.restore		= pm_sleep_ptr(virtio_i2c_restore),
>  };
>  module_virtio_driver(virtio_i2c_driver);
>  

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH 23/23] i2c: mux: pca954x: Remove #ifdef guards for PM related functions
  2023-07-05 20:45   ` [PATCH 23/23] i2c: mux: pca954x: " Paul Cercueil
  2023-07-06  3:07     ` Jonathan Cameron
@ 2023-07-06  6:31     ` Peter Rosin
  1 sibling, 0 replies; 57+ messages in thread
From: Peter Rosin @ 2023-07-06  6:31 UTC (permalink / raw)
  To: Paul Cercueil, Wolfram Sang; +Cc: linux-i2c, linux-kernel

Hi!

2023-07-05 at 22:45, Paul Cercueil wrote:
> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Acked-by: Peter Rosin <peda@axentia.se>

Cheers,
Peter

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

* Re: [PATCH 06/23] i2c: designware: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 06/23] i2c: designware: " Paul Cercueil
  2023-07-06  2:18   ` Jonathan Cameron
@ 2023-07-06  9:11   ` Andy Shevchenko
  1 sibling, 0 replies; 57+ messages in thread
From: Andy Shevchenko @ 2023-07-06  9:11 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Jarkko Nikula,
	Mika Westerberg, Jan Dabros

On Wed, Jul 05, 2023 at 10:42:57PM +0200, Paul Cercueil wrote:
> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.

I have wip of something like this in a private branch, so
I'm glad you beat me up to it!

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

> ---
> Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Jan Dabros <jsd@semihalf.com>
> ---
>  drivers/i2c/busses/i2c-designware-platdrv.c | 22 ++++++---------------
>  1 file changed, 6 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 970c1c3b0402..855b698e99c0 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -418,7 +418,6 @@ static void dw_i2c_plat_remove(struct platform_device *pdev)
>  	reset_control_assert(dev->rst);
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int dw_i2c_plat_prepare(struct device *dev)
>  {
>  	/*
> @@ -429,11 +428,7 @@ static int dw_i2c_plat_prepare(struct device *dev)
>  	 */
>  	return !has_acpi_companion(dev);
>  }
> -#else
> -#define dw_i2c_plat_prepare	NULL
> -#endif
>  
> -#ifdef CONFIG_PM
>  static int dw_i2c_plat_runtime_suspend(struct device *dev)
>  {
>  	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
> @@ -447,7 +442,7 @@ static int dw_i2c_plat_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused dw_i2c_plat_suspend(struct device *dev)
> +static int dw_i2c_plat_suspend(struct device *dev)
>  {
>  	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
>  
> @@ -468,7 +463,7 @@ static int dw_i2c_plat_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
> +static int dw_i2c_plat_resume(struct device *dev)
>  {
>  	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
>  
> @@ -479,16 +474,11 @@ static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
>  }
>  
>  static const struct dev_pm_ops dw_i2c_dev_pm_ops = {
> -	.prepare = dw_i2c_plat_prepare,
> -	SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)
> -	SET_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL)
> +	.prepare = pm_sleep_ptr(dw_i2c_plat_prepare),
> +	LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)
> +	RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL)
>  };
>  
> -#define DW_I2C_DEV_PMOPS (&dw_i2c_dev_pm_ops)
> -#else
> -#define DW_I2C_DEV_PMOPS NULL
> -#endif
> -
>  /* Work with hotplug and coldplug */
>  MODULE_ALIAS("platform:i2c_designware");
>  
> @@ -499,7 +489,7 @@ static struct platform_driver dw_i2c_driver = {
>  		.name	= "i2c_designware",
>  		.of_match_table = of_match_ptr(dw_i2c_of_match),
>  		.acpi_match_table = ACPI_PTR(dw_i2c_acpi_match),
> -		.pm	= DW_I2C_DEV_PMOPS,
> +		.pm	= pm_ptr(&dw_i2c_dev_pm_ops),
>  	},
>  };
>  
> -- 
> 2.40.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 03/23] i2c: iproc: Remove #ifdef guards for PM related functions
  2023-07-05 20:42 ` [PATCH 03/23] i2c: iproc: " Paul Cercueil
  2023-07-06  2:11   ` Jonathan Cameron
@ 2023-07-06 17:01   ` Ray Jui
  1 sibling, 0 replies; 57+ messages in thread
From: Ray Jui @ 2023-07-06 17:01 UTC (permalink / raw)
  To: Paul Cercueil, Wolfram Sang
  Cc: linux-i2c, linux-kernel, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]



On 7/5/2023 1:42 PM, Paul Cercueil wrote:
> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> 
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
> ---
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  drivers/i2c/busses/i2c-bcm-iproc.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
> index 2d8342fdc25d..8a3e2208475c 100644
> --- a/drivers/i2c/busses/i2c-bcm-iproc.c
> +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
> @@ -1125,8 +1125,6 @@ static void bcm_iproc_i2c_remove(struct platform_device *pdev)
>  	bcm_iproc_i2c_enable_disable(iproc_i2c, false);
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
> -
>  static int bcm_iproc_i2c_suspend(struct device *dev)
>  {
>  	struct bcm_iproc_i2c_dev *iproc_i2c = dev_get_drvdata(dev);
> @@ -1177,12 +1175,6 @@ static const struct dev_pm_ops bcm_iproc_i2c_pm_ops = {
>  	.resume_early = &bcm_iproc_i2c_resume
>  };
>  
> -#define BCM_IPROC_I2C_PM_OPS (&bcm_iproc_i2c_pm_ops)
> -#else
> -#define BCM_IPROC_I2C_PM_OPS NULL
> -#endif /* CONFIG_PM_SLEEP */
> -
> -
>  static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave)
>  {
>  	struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(slave->adapter);
> @@ -1255,7 +1247,7 @@ static struct platform_driver bcm_iproc_i2c_driver = {
>  	.driver = {
>  		.name = "bcm-iproc-i2c",
>  		.of_match_table = bcm_iproc_i2c_of_match,
> -		.pm = BCM_IPROC_I2C_PM_OPS,
> +		.pm = pm_sleep_ptr(&bcm_iproc_i2c_pm_ops),
>  	},
>  	.probe = bcm_iproc_i2c_probe,
>  	.remove_new = bcm_iproc_i2c_remove,

Thanks.

Acked-by: Ray Jui <ray.jui@broadcom.com>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4194 bytes --]

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

* Re: [PATCH 14/23] i2c: nomadik: Remove #ifdef guards for PM related functions
  2023-07-05 20:43 ` [PATCH 14/23] i2c: nomadik: " Paul Cercueil
  2023-07-06  2:41   ` Jonathan Cameron
@ 2023-07-06 17:12   ` Linus Walleij
  1 sibling, 0 replies; 57+ messages in thread
From: Linus Walleij @ 2023-07-06 17:12 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wolfram Sang, linux-i2c, linux-kernel, linux-arm-kernel

On Wed, Jul 5, 2023 at 10:43 PM Paul Cercueil <paul@crapouillou.net> wrote:

> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> 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.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Looks correct!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions
  2023-07-06  2:09   ` Jonathan Cameron
@ 2023-07-08  8:42     ` Paul Cercueil
  0 siblings, 0 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-08  8:42 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Elie Morisse,
	Shyam Sundar S K

Hi Jonathan,

Le jeudi 06 juillet 2023 à 10:09 +0800, Jonathan Cameron a écrit :
> On Wed,  5 Jul 2023 22:42:52 +0200
> Paul Cercueil <paul@crapouillou.net> wrote:
> 
> > Use the new PM macros for the suspend and resume functions to be
> > automatically dropped by the compiler when CONFIG_PM or
> > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> > 
> > 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.
> > 
> > Note that the use of the UNIVERSAL_DEV_PM_OPS() macro was likely to
> > be
> > wrong, as it sets the same callbacks for the runtime-PM and system
> > suspend/resume. This patch does not change this behaviour, but I
> > suspect
> > that it should be changed to use DEFINE_RUNTIME_DEV_PM_OPS()
> > instead, as
> > the current documentation for UNIVERSAL_DEV_PM_OPS() suggests.
> 
> I'd be tempted to leave this one alone because it'll be much harder
> to spot that it's an ex UNIVERSAL_DEV_PM_OPS() that needs some
> thinking
> about after this change.

Ok, that's a good point.

Cheers,
-Paul

> > 
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > 
> > ---
> > Cc: Elie Morisse <syniurge@gmail.com>
> > Cc: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
> > ---
> >  drivers/i2c/busses/i2c-amd-mp2-pci.c  | 14 +++++---------
> >  drivers/i2c/busses/i2c-amd-mp2-plat.c |  8 ++------
> >  drivers/i2c/busses/i2c-amd-mp2.h      |  2 --
> >  3 files changed, 7 insertions(+), 17 deletions(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c
> > b/drivers/i2c/busses/i2c-amd-mp2-pci.c
> > index 143165300949..114fe329279a 100644
> > --- a/drivers/i2c/busses/i2c-amd-mp2-pci.c
> > +++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c
> > @@ -382,7 +382,6 @@ static void amd_mp2_pci_remove(struct pci_dev
> > *pci_dev)
> >         amd_mp2_clear_reg(privdata);
> >  }
> >  
> > -#ifdef CONFIG_PM
> >  static int amd_mp2_pci_suspend(struct device *dev)
> >  {
> >         struct pci_dev *pci_dev = to_pci_dev(dev);
> > @@ -434,9 +433,10 @@ static int amd_mp2_pci_resume(struct device
> > *dev)
> >         return ret;
> >  }
> >  
> > -static UNIVERSAL_DEV_PM_OPS(amd_mp2_pci_pm_ops,
> > amd_mp2_pci_suspend,
> > -                           amd_mp2_pci_resume, NULL);
> > -#endif /* CONFIG_PM */
> > +static const struct dev_pm_ops amd_mp2_pci_pm_ops = {
> > +       SYSTEM_SLEEP_PM_OPS(amd_mp2_pci_suspend,
> > amd_mp2_pci_resume)
> > +       RUNTIME_PM_OPS(amd_mp2_pci_suspend, amd_mp2_pci_resume,
> > NULL)
> > +};
> >  
> >  static const struct pci_device_id amd_mp2_pci_tbl[] = {
> >         {PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_MP2)},
> > @@ -449,11 +449,7 @@ static struct pci_driver amd_mp2_pci_driver =
> > {
> >         .id_table       = amd_mp2_pci_tbl,
> >         .probe          = amd_mp2_pci_probe,
> >         .remove         = amd_mp2_pci_remove,
> > -#ifdef CONFIG_PM
> > -       .driver = {
> > -               .pm     = &amd_mp2_pci_pm_ops,
> > -       },
> > -#endif
> > +       .driver.pm      = pm_ptr(&amd_mp2_pci_pm_ops),
> >  };
> >  module_pci_driver(amd_mp2_pci_driver);
> >  
> > diff --git a/drivers/i2c/busses/i2c-amd-mp2-plat.c
> > b/drivers/i2c/busses/i2c-amd-mp2-plat.c
> > index 112fe2bc5662..4c677aeaca29 100644
> > --- a/drivers/i2c/busses/i2c-amd-mp2-plat.c
> > +++ b/drivers/i2c/busses/i2c-amd-mp2-plat.c
> > @@ -183,7 +183,6 @@ static const struct i2c_algorithm
> > i2c_amd_algorithm = {
> >         .functionality = i2c_amd_func,
> >  };
> >  
> > -#ifdef CONFIG_PM
> >  static int i2c_amd_suspend(struct amd_i2c_common *i2c_common)
> >  {
> >         struct amd_i2c_dev *i2c_dev =
> > amd_i2c_dev_common(i2c_common);
> > @@ -198,7 +197,6 @@ static int i2c_amd_resume(struct amd_i2c_common
> > *i2c_common)
> >  
> >         return i2c_amd_enable_set(i2c_dev, true);
> >  }
> > -#endif
> >  
> >  static const u32 supported_speeds[] = {
> >         I2C_MAX_HIGH_SPEED_MODE_FREQ,
> > @@ -276,10 +274,8 @@ static int i2c_amd_probe(struct
> > platform_device *pdev)
> >         platform_set_drvdata(pdev, i2c_dev);
> >  
> >         i2c_dev->common.cmd_completion = &i2c_amd_cmd_completion;
> > -#ifdef CONFIG_PM
> > -       i2c_dev->common.suspend = &i2c_amd_suspend;
> > -       i2c_dev->common.resume = &i2c_amd_resume;
> > -#endif
> > +       i2c_dev->common.suspend = pm_ptr(&i2c_amd_suspend);
> > +       i2c_dev->common.resume = pm_ptr(&i2c_amd_resume);
> >  
> >         /* Register the adapter */
> >         amd_mp2_pm_runtime_get(mp2_dev);
> > diff --git a/drivers/i2c/busses/i2c-amd-mp2.h
> > b/drivers/i2c/busses/i2c-amd-mp2.h
> > index 018a42de8b1e..40f3cdcc60aa 100644
> > --- a/drivers/i2c/busses/i2c-amd-mp2.h
> > +++ b/drivers/i2c/busses/i2c-amd-mp2.h
> > @@ -160,10 +160,8 @@ struct amd_i2c_common {
> >         enum speed_enum i2c_speed;
> >         u8 *dma_buf;
> >         dma_addr_t dma_addr;
> > -#ifdef CONFIG_PM
> >         int (*suspend)(struct amd_i2c_common *i2c_common);
> >         int (*resume)(struct amd_i2c_common *i2c_common);
> > -#endif /* CONFIG_PM */
> >  };
> >  
> >  /**
> 


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

* Re: [PATCH 10/23] i2c: img-scb: Remove #ifdef guards for PM related functions
  2023-07-06  2:31   ` Jonathan Cameron
@ 2023-07-08  8:46     ` Paul Cercueil
  0 siblings, 0 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-08  8:46 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Wolfram Sang, linux-i2c, linux-kernel

Hi Jonathan,

Le jeudi 06 juillet 2023 à 10:31 +0800, Jonathan Cameron a écrit :
> On Wed,  5 Jul 2023 22:43:01 +0200
> Paul Cercueil <paul@crapouillou.net> wrote:
> 
> > Use the new PM macros for the suspend and resume functions to be
> > automatically dropped by the compiler when CONFIG_PM or
> > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> > 
> > 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.
> > 
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> I thought the _DEFINE macros weren't really intended for driver
> usage and it's good to keep the ability to change those details
> without updating lots of drivers.  Perhaps just express it long hand
> here?

Yeah you are right. The "long version" isn't much longer anyway.

Cheers,
-Paul

> Jonathan
> 
> 
> > ---
> >  drivers/i2c/busses/i2c-img-scb.c | 13 ++++---------
> >  1 file changed, 4 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-img-scb.c
> > b/drivers/i2c/busses/i2c-img-scb.c
> > index 4b674cfbc6fb..a92e3082542e 100644
> > --- a/drivers/i2c/busses/i2c-img-scb.c
> > +++ b/drivers/i2c/busses/i2c-img-scb.c
> > @@ -1454,7 +1454,6 @@ static int img_i2c_runtime_resume(struct
> > device *dev)
> >         return 0;
> >  }
> >  
> > -#ifdef CONFIG_PM_SLEEP
> >  static int img_i2c_suspend(struct device *dev)
> >  {
> >         struct img_i2c *i2c = dev_get_drvdata(dev);
> > @@ -1482,14 +1481,10 @@ static int img_i2c_resume(struct device
> > *dev)
> >  
> >         return 0;
> >  }
> > -#endif /* CONFIG_PM_SLEEP */
> >  
> > -static const struct dev_pm_ops img_i2c_pm = {
> > -       SET_RUNTIME_PM_OPS(img_i2c_runtime_suspend,
> > -                          img_i2c_runtime_resume,
> > -                          NULL)
> > -       SET_SYSTEM_SLEEP_PM_OPS(img_i2c_suspend, img_i2c_resume)
> > -};
> > +static _DEFINE_DEV_PM_OPS(img_i2c_pm, img_i2c_suspend,
> > img_i2c_resume,
> > +                         img_i2c_runtime_suspend,
> > img_i2c_runtime_resume,
> > +                         NULL);
> >  
> >  static const struct of_device_id img_scb_i2c_match[] = {
> >         { .compatible = "img,scb-i2c" },
> > @@ -1501,7 +1496,7 @@ static struct platform_driver
> > img_scb_i2c_driver = {
> >         .driver = {
> >                 .name           = "img-i2c-scb",
> >                 .of_match_table = img_scb_i2c_match,
> > -               .pm             = &img_i2c_pm,
> > +               .pm             = pm_ptr(&img_i2c_pm),
> >         },
> >         .probe = img_i2c_probe,
> >         .remove_new = img_i2c_remove,
> 


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

* Re: [PATCH 11/23] i2c: kempld: Remove #ifdef guards for PM related functions
  2023-07-06  2:37   ` Jonathan Cameron
@ 2023-07-08  9:13     ` Paul Cercueil
  0 siblings, 0 replies; 57+ messages in thread
From: Paul Cercueil @ 2023-07-08  9:13 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Wolfram Sang, linux-i2c, linux-kernel

Hi Jonathan,

Le jeudi 06 juillet 2023 à 10:37 +0800, Jonathan Cameron a écrit :
> On Wed,  5 Jul 2023 22:43:02 +0200
> Paul Cercueil <paul@crapouillou.net> wrote:
> 
> > Use the new PM macros for the suspend and resume functions to be
> > automatically dropped by the compiler when CONFIG_PM or
> > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> > 
> > 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.
> > 
> > Note that the driver should most likely be updated to use the
> > platform_driver.driver.pm.{suspend,resume} callbacks.
> 
> Agreed.  In this particular case I'd be tempted to do that first
> so that we don't introduce pm_ptr() usage for these hooks.
> Look at the platform device core, I suspect they should be
> pm_sleep_ptr()
> but not 100% sure.

Ok, I'll just convert it then, the diff won't be much bigger.

Cheers,
-Paul

> Jonathan
> 
> > 
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > ---
> >  drivers/i2c/busses/i2c-kempld.c | 9 ++-------
> >  1 file changed, 2 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-kempld.c
> > b/drivers/i2c/busses/i2c-kempld.c
> > index 281058e3ea46..cb61e7b9202c 100644
> > --- a/drivers/i2c/busses/i2c-kempld.c
> > +++ b/drivers/i2c/busses/i2c-kempld.c
> > @@ -350,7 +350,6 @@ static void kempld_i2c_remove(struct
> > platform_device *pdev)
> >         i2c_del_adapter(&i2c->adap);
> >  }
> >  
> > -#ifdef CONFIG_PM
> >  static int kempld_i2c_suspend(struct platform_device *pdev,
> > pm_message_t state)
> >  {
> >         struct kempld_i2c_data *i2c = platform_get_drvdata(pdev);
> > @@ -377,10 +376,6 @@ static int kempld_i2c_resume(struct
> > platform_device *pdev)
> >  
> >         return 0;
> >  }
> > -#else
> > -#define kempld_i2c_suspend     NULL
> > -#define kempld_i2c_resume      NULL
> > -#endif
> >  
> >  static struct platform_driver kempld_i2c_driver = {
> >         .driver = {
> > @@ -388,8 +383,8 @@ static struct platform_driver kempld_i2c_driver
> > = {
> >         },
> >         .probe          = kempld_i2c_probe,
> >         .remove_new     = kempld_i2c_remove,
> > -       .suspend        = kempld_i2c_suspend,
> > -       .resume         = kempld_i2c_resume,
> > +       .suspend        = pm_ptr(kempld_i2c_suspend),
> > +       .resume         = pm_ptr(kempld_i2c_resume),
> >  };
> >  
> >  module_platform_driver(kempld_i2c_driver);
> 


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

* Re: [PATCH 21/23] i2c: sh-mobile: Remove #ifdef guards for PM related functions
  2023-07-05 20:45   ` [PATCH 21/23] i2c: sh-mobile: " Paul Cercueil
  2023-07-06  3:07     ` Jonathan Cameron
@ 2023-07-10 12:40     ` Geert Uytterhoeven
  1 sibling, 0 replies; 57+ messages in thread
From: Geert Uytterhoeven @ 2023-07-10 12:40 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Wolfram Sang,
	linux-renesas-soc

On Wed, Jul 5, 2023 at 10:49 PM Paul Cercueil <paul@crapouillou.net> wrote:
> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> 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.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 19/23] i2c: rcar: Remove #ifdef guards for PM related functions
  2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
                     ` (4 preceding siblings ...)
  2023-07-06  2:52   ` [PATCH 19/23] i2c: rcar: " Jonathan Cameron
@ 2023-07-10 12:41   ` Geert Uytterhoeven
  5 siblings, 0 replies; 57+ messages in thread
From: Geert Uytterhoeven @ 2023-07-10 12:41 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wolfram Sang, linux-i2c, linux-kernel, Wolfram Sang,
	linux-renesas-soc

On Wed, Jul 5, 2023 at 10:49 PM Paul Cercueil <paul@crapouillou.net> wrote:
> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> 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.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2023-07-10 12:41 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05 20:42 [PATCH 00/23] i2c: Use new PM macros Paul Cercueil
2023-07-05 20:42 ` [PATCH 01/23] i2c: amd-mp2: Remove #ifdef guards for PM related functions Paul Cercueil
2023-07-06  2:09   ` Jonathan Cameron
2023-07-08  8:42     ` Paul Cercueil
2023-07-05 20:42 ` [PATCH 02/23] i2c: au1550: " Paul Cercueil
2023-07-06  2:10   ` Jonathan Cameron
2023-07-05 20:42 ` [PATCH 03/23] i2c: iproc: " Paul Cercueil
2023-07-06  2:11   ` Jonathan Cameron
2023-07-06 17:01   ` Ray Jui
2023-07-05 20:42 ` [PATCH 04/23] i2c: brcmstb: " Paul Cercueil
2023-07-06  2:12   ` Jonathan Cameron
2023-07-05 20:42 ` [PATCH 05/23] i2c: davinci: " Paul Cercueil
2023-07-06  2:15   ` Jonathan Cameron
2023-07-05 20:42 ` [PATCH 06/23] i2c: designware: " Paul Cercueil
2023-07-06  2:18   ` Jonathan Cameron
2023-07-06  9:11   ` Andy Shevchenko
2023-07-05 20:42 ` [PATCH 07/23] i2c: exynos5: " Paul Cercueil
2023-07-06  2:25   ` Jonathan Cameron
2023-07-05 20:42 ` [PATCH 08/23] i2c: hix5hd2: " Paul Cercueil
2023-07-06  2:27   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 09/23] i2c: i801: " Paul Cercueil
2023-07-06  2:28   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 10/23] i2c: img-scb: " Paul Cercueil
2023-07-06  2:31   ` Jonathan Cameron
2023-07-08  8:46     ` Paul Cercueil
2023-07-05 20:43 ` [PATCH 11/23] i2c: kempld: " Paul Cercueil
2023-07-06  2:37   ` Jonathan Cameron
2023-07-08  9:13     ` Paul Cercueil
2023-07-05 20:43 ` [PATCH 12/23] i2c: lpc2k: " Paul Cercueil
2023-07-06  2:39   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 13/23] i2c: mt65xx: " Paul Cercueil
2023-07-06  2:40   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 14/23] i2c: nomadik: " Paul Cercueil
2023-07-06  2:41   ` Jonathan Cameron
2023-07-06 17:12   ` Linus Walleij
2023-07-05 20:43 ` [PATCH 15/23] i2c: ocores: " Paul Cercueil
2023-07-06  2:42   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 16/23] i2c: pnx: " Paul Cercueil
2023-07-06  2:49   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 17/23] i2c: pxa: " Paul Cercueil
2023-07-06  2:50   ` Jonathan Cameron
2023-07-05 20:43 ` [PATCH 18/23] i2c: qup: " Paul Cercueil
2023-07-06  2:51   ` Jonathan Cameron
2023-07-05 20:45 ` [PATCH 19/23] i2c: rcar: " Paul Cercueil
2023-07-05 20:45   ` [PATCH 20/23] i2c: s3c2410: " Paul Cercueil
2023-07-06  3:06     ` Jonathan Cameron
2023-07-05 20:45   ` [PATCH 21/23] i2c: sh-mobile: " Paul Cercueil
2023-07-06  3:07     ` Jonathan Cameron
2023-07-10 12:40     ` Geert Uytterhoeven
2023-07-05 20:45   ` [PATCH 22/23] i2c: virtio: " Paul Cercueil
2023-07-06  3:07     ` Jonathan Cameron
2023-07-06  4:27     ` Viresh Kumar
2023-07-05 20:45   ` [PATCH 23/23] i2c: mux: pca954x: " Paul Cercueil
2023-07-06  3:07     ` Jonathan Cameron
2023-07-06  6:31     ` Peter Rosin
2023-07-06  2:52   ` [PATCH 19/23] i2c: rcar: " Jonathan Cameron
2023-07-10 12:41   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).