Skip to contentSkip to conversation

media: renesas: Convert to modern *_PM_OPS()

PATCH In review Geert Uytterhoeven 5 participants 19 messages Jul 9, 2025 – Jul 10, 2025

Subsystems (7)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover media: renesas: Convert to modern *_PM_OPS()

Hi all,

This patch series converts the Renesas media drivers from the old SIMPLE_DEV_PM_OPS(), SET_SYSTEM_SLEEP_PM_OPS(), and SET_RUNTIME_PM_OPS() helpers to the modern DEFINE_SIMPLE_DEV_PM_OPS(), SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS(), pm_ptr(), and pm_sleep_ptr() helpers. This lets us drop the __maybe_unused annotations from power management callbacks, and reduces kernel size in case power management or sleep support is not enabled.

Thanks for your comments!

Geert Uytterhoeven (5):
media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
media: renesas: ceu: Convert to RUNTIME_PM_OPS()
media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()

 .../media/platform/renesas/rcar-vin/rcar-core.c    |  8 ++++----
 drivers/media/platform/renesas/rcar_drif.c         | 10 +++++-----
 drivers/media/platform/renesas/rcar_fdp1.c         | 10 ++++------
 drivers/media/platform/renesas/renesas-ceu.c       | 10 ++++------
 drivers/media/platform/renesas/vsp1/vsp1_drv.c     | 14 +++++++-------
 5 files changed, 24 insertions(+), 28 deletions(-)
Signature · 12 lines
2.43.0

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
author maintainer
#1 lore raw

PATCH 1/5 media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Convert the Renesas Digital Radio Interface driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

---
 drivers/media/platform/renesas/rcar_drif.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/platform/renesas/rcar_drif.c +5 -5
index fc8b6bbef793c64e..0f0c5844e22ea86c 100644
@@ -1446,18 +1446,18 @@ static void rcar_drif_remove(struct platform_device *pdev)
 }
 
 /* FIXME: Implement suspend/resume support */
-static int __maybe_unused rcar_drif_suspend(struct device *dev)
+static int rcar_drif_suspend(struct device *dev)
 {
 	return 0;
 }
 
-static int __maybe_unused rcar_drif_resume(struct device *dev)
+static int rcar_drif_resume(struct device *dev)
 {
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(rcar_drif_pm_ops, rcar_drif_suspend,
-			 rcar_drif_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rcar_drif_pm_ops, rcar_drif_suspend,
+				rcar_drif_resume);
 
 static const struct of_device_id rcar_drif_of_table[] = {
 	{ .compatible = "renesas,rcar-gen3-drif" },
@@ -1470,7 +1470,7 @@ static struct platform_driver rcar_drif_driver = {
 	.driver = {
 		.name = RCAR_DRIF_DRV_NAME,
 		.of_match_table = rcar_drif_of_table,
-		.pm = &rcar_drif_pm_ops,
+		.pm = pm_sleep_ptr(&rcar_drif_pm_ops),
 		},
 	.probe = rcar_drif_probe,
 	.remove = rcar_drif_remove,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/5
#2 lore raw

RE: [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Quoted 10 lines

From: Geert Uytterhoeven <[email protected]>
Sent: 09 July 2025 20:16
To: Niklas Söderlund <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Fabrizio Castro <[email protected]>; Kieran Bingham <[email protected]>; Jacopo Mondi <[email protected]>; laurent.pinchart <[email protected]>
Cc: [email protected]; [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Quoted 7 lines

Convert the Renesas Digital Radio Interface driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

Quoted 43 lines
---
 drivers/media/platform/renesas/rcar_drif.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/platform/renesas/rcar_drif.c +5 -6
index fc8b6bbef793c64e..0f0c5844e22ea86c 100644
@@ -1446,18 +1446,18 @@ static void rcar_drif_remove(struct platform_device *pdev)
 }
 
 /* FIXME: Implement suspend/resume support */
-static int __maybe_unused rcar_drif_suspend(struct device *dev)
+static int rcar_drif_suspend(struct device *dev)
 {
 	return 0;
 }
 
-static int __maybe_unused rcar_drif_resume(struct device *dev)
+static int rcar_drif_resume(struct device *dev)
 {
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(rcar_drif_pm_ops, rcar_drif_suspend,
-			 rcar_drif_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rcar_drif_pm_ops, rcar_drif_suspend,
+				rcar_drif_resume);
 
 static const struct of_device_id rcar_drif_of_table[] = {
 	{ .compatible = "renesas,rcar-gen3-drif" },
@@ -1470,7 +1470,7 @@ static struct platform_driver rcar_drif_driver = {
 	.driver = {
 		.name = RCAR_DRIF_DRV_NAME,
 		.of_match_table = rcar_drif_of_table,
-		.pm = &rcar_drif_pm_ops,
+		.pm = pm_sleep_ptr(&rcar_drif_pm_ops),
 		},
 	.probe = rcar_drif_probe,
 	.remove = rcar_drif_remove,
--

2.43.0

maintainer Reviewed-by on v1 1/5
#3 lore raw

Re: [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

In reply to Geert Uytterhoeven
Quoted 39 lines · Geert Uytterhoeven

Convert the Renesas Digital Radio Interface driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

---
 drivers/media/platform/renesas/rcar_drif.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/platform/renesas/rcar_drif.c +4 -4
index fc8b6bbef793c64e..0f0c5844e22ea86c 100644
@@ -1446,18 +1446,18 @@ static void rcar_drif_remove(struct platform_device *pdev)
 }
 
 /* FIXME: Implement suspend/resume support */
-static int __maybe_unused rcar_drif_suspend(struct device *dev)
+static int rcar_drif_suspend(struct device *dev)
 {
 	return 0;
 }
 
-static int __maybe_unused rcar_drif_resume(struct device *dev)
+static int rcar_drif_resume(struct device *dev)
 {
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(rcar_drif_pm_ops, rcar_drif_suspend,
-			 rcar_drif_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rcar_drif_pm_ops, rcar_drif_suspend,
+				rcar_drif_resume);
 
 static const struct of_device_id rcar_drif_of_table[] = {
 	{ .compatible = "renesas,rcar-gen3-drif" },

drivers/media/platform/renesas/rcar_drif.c static struct platform_driver rcar_drif_driver = { · line 1474

Quoted 6 lines
drivers/media/platform/renesas/rcar_drif.c +1 -1
@@ -1470,7 +1470,7 @@ static struct platform_driver rcar_drif_driver = {
 	.driver = {
 		.name = RCAR_DRIF_DRV_NAME,
 		.of_match_table = rcar_drif_of_table,
-		.pm = &rcar_drif_pm_ops,
+		.pm = pm_sleep_ptr(&rcar_drif_pm_ops),
 		},

While at it, let's fix the indentation issue here. I can do so when applying, no need to resend just for this.

Quoted 2 lines
drivers/media/platform/renesas/rcar_drif.c +0 -0
 	.probe = rcar_drif_probe,
 	.remove = rcar_drif_remove,
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#4 lore raw

PATCH 2/5 media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

In reply to Geert Uytterhoeven

Convert the Renesas R-Car Video Input driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

---
 drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/renesas/rcar-vin/rcar-core.c +4 -4
index f73729f59671be20..100105b620e31e58 100644
@@ -849,7 +849,7 @@ static int rvin_isp_init(struct rvin_dev *vin)
  * Suspend / Resume
  */
 
-static int __maybe_unused rvin_suspend(struct device *dev)
+static int rvin_suspend(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -861,7 +861,7 @@ static int __maybe_unused rvin_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused rvin_resume(struct device *dev)
+static int rvin_resume(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -1276,13 +1276,13 @@ static void rcar_vin_remove(struct platform_device *pdev)
 	rvin_dma_unregister(vin);
 }
 
-static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
 
 static struct platform_driver rcar_vin_driver = {
 	.driver = {
 		.name = "rcar-vin",
 		.suppress_bind_attrs = true,
-		.pm = &rvin_pm_ops,
+		.pm = pm_sleep_ptr(&rvin_pm_ops),
 		.of_match_table = rvin_of_id_table,
 	},
 	.probe = rcar_vin_probe,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 2/5
#5 lore raw

RE: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Quoted 10 lines

From: Geert Uytterhoeven <[email protected]>
Sent: 09 July 2025 20:16
To: Niklas Söderlund <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Fabrizio Castro <[email protected]>; Kieran Bingham <[email protected]>; Jacopo Mondi <[email protected]>; laurent.pinchart <[email protected]>
Cc: [email protected]; [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Quoted 6 lines

Convert the Renesas R-Car Video Input driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

Quoted 45 lines
---
 drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/renesas/rcar- renamed from drivers/media/platform/renesas/rcar-vin/rcar-core.c +0 -0

vin/rcar-core.c
index f73729f59671be20..100105b620e31e58 100644

drivers/media/platform/renesas/rcar-vin/rcar-core.c +4 -5
@@ -849,7 +849,7 @@ static int rvin_isp_init(struct rvin_dev *vin)
  * Suspend / Resume
  */
 
-static int __maybe_unused rvin_suspend(struct device *dev)
+static int rvin_suspend(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -861,7 +861,7 @@ static int __maybe_unused rvin_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused rvin_resume(struct device *dev)
+static int rvin_resume(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -1276,13 +1276,13 @@ static void rcar_vin_remove(struct platform_device *pdev)
 	rvin_dma_unregister(vin);
 }
 
-static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
 
 static struct platform_driver rcar_vin_driver = {
 	.driver = {
 		.name = "rcar-vin",
 		.suppress_bind_attrs = true,
-		.pm = &rvin_pm_ops,
+		.pm = pm_sleep_ptr(&rvin_pm_ops),
 		.of_match_table = rvin_of_id_table,
 	},
 	.probe = rcar_vin_probe,
--

2.43.0

maintainer Reviewed-by on v1 2/5
#6 lore raw

Re: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

In reply to Geert Uytterhoeven

Hi Geert,

Thanks for your work.

Quoted 6 lines · Geert Uytterhoeven

Convert the Renesas R-Car Video Input driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

Quoted 45 lines
---
 drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/renesas/rcar-vin/rcar-core.c +4 -4
index f73729f59671be20..100105b620e31e58 100644
@@ -849,7 +849,7 @@ static int rvin_isp_init(struct rvin_dev *vin)
  * Suspend / Resume
  */
 
-static int __maybe_unused rvin_suspend(struct device *dev)
+static int rvin_suspend(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -861,7 +861,7 @@ static int __maybe_unused rvin_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused rvin_resume(struct device *dev)
+static int rvin_resume(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -1276,13 +1276,13 @@ static void rcar_vin_remove(struct platform_device *pdev)
 	rvin_dma_unregister(vin);
 }
 
-static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
 
 static struct platform_driver rcar_vin_driver = {
 	.driver = {
 		.name = "rcar-vin",
 		.suppress_bind_attrs = true,
-		.pm = &rvin_pm_ops,
+		.pm = pm_sleep_ptr(&rvin_pm_ops),
 		.of_match_table = rvin_of_id_table,
 	},
 	.probe = rcar_vin_probe,
Signature · 1 line
2.43.0
Signature · 2 lines
Kind Regards,
Niklas Söderlund
maintainer Reviewed-by on v1 2/5
#7 lore raw

Re: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

In reply to Geert Uytterhoeven

Hi Geert,

Thank you for the patch.

Quoted 6 lines · Geert Uytterhoeven

Convert the Renesas R-Car Video Input driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

Quoted 42 lines
---
 drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/renesas/rcar-vin/rcar-core.c +4 -4
index f73729f59671be20..100105b620e31e58 100644
@@ -849,7 +849,7 @@ static int rvin_isp_init(struct rvin_dev *vin)
  * Suspend / Resume
  */
 
-static int __maybe_unused rvin_suspend(struct device *dev)
+static int rvin_suspend(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -861,7 +861,7 @@ static int __maybe_unused rvin_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused rvin_resume(struct device *dev)
+static int rvin_resume(struct device *dev)
 {
 	struct rvin_dev *vin = dev_get_drvdata(dev);
 
@@ -1276,13 +1276,13 @@ static void rcar_vin_remove(struct platform_device *pdev)
 	rvin_dma_unregister(vin);
 }
 
-static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
 
 static struct platform_driver rcar_vin_driver = {
 	.driver = {
 		.name = "rcar-vin",
 		.suppress_bind_attrs = true,
-		.pm = &rvin_pm_ops,
+		.pm = pm_sleep_ptr(&rvin_pm_ops),
 		.of_match_table = rvin_of_id_table,
 	},
 	.probe = rcar_vin_probe,
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#8 lore raw

PATCH 3/5 media: renesas: fdp1: Convert to RUNTIME_PM_OPS()

In reply to Geert Uytterhoeven

Convert the Renesas Fine Display Processor driver from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS() and pm_ptr(). This lets us drop the __maybe_unused annotations from its runtime suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

---
 drivers/media/platform/renesas/rcar_fdp1.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/media/platform/renesas/rcar_fdp1.c +4 -6
index 5d453a7a89889fa3..a40e48a7078f11b6 100644
@@ -2409,7 +2409,7 @@ static void fdp1_remove(struct platform_device *pdev)
 	rcar_fcp_put(fdp1->fcp);
 }
 
-static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
+static int fdp1_pm_runtime_suspend(struct device *dev)
 {
 	struct fdp1_dev *fdp1 = dev_get_drvdata(dev);
 
@@ -2418,7 +2418,7 @@ static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused fdp1_pm_runtime_resume(struct device *dev)
+static int fdp1_pm_runtime_resume(struct device *dev)
 {
 	struct fdp1_dev *fdp1 = dev_get_drvdata(dev);
 
@@ -2429,9 +2429,7 @@ static int __maybe_unused fdp1_pm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops fdp1_pm_ops = {
-	SET_RUNTIME_PM_OPS(fdp1_pm_runtime_suspend,
-			   fdp1_pm_runtime_resume,
-			   NULL)
+	RUNTIME_PM_OPS(fdp1_pm_runtime_suspend, fdp1_pm_runtime_resume, NULL)
 };
 
 static const struct of_device_id fdp1_dt_ids[] = {
@@ -2446,7 +2444,7 @@ static struct platform_driver fdp1_pdrv = {
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = fdp1_dt_ids,
-		.pm	= &fdp1_pm_ops,
+		.pm	= pm_ptr(&fdp1_pm_ops),
 	},
 };
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 3/5
#9 lore raw

RE: [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()

Quoted 10 lines

From: Geert Uytterhoeven <[email protected]>
Sent: 09 July 2025 20:16
To: Niklas Söderlund <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Fabrizio Castro <[email protected]>; Kieran Bingham <[email protected]>; Jacopo Mondi <[email protected]>; laurent.pinchart <[email protected]>
Cc: [email protected]; [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()

Quoted 6 lines

Convert the Renesas Fine Display Processor driver from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS() and pm_ptr(). This lets us drop the __maybe_unused annotations from its runtime suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

Quoted 48 lines
---
 drivers/media/platform/renesas/rcar_fdp1.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/media/platform/renesas/rcar_fdp1.c +4 -7
index 5d453a7a89889fa3..a40e48a7078f11b6 100644
@@ -2409,7 +2409,7 @@ static void fdp1_remove(struct platform_device *pdev)
 	rcar_fcp_put(fdp1->fcp);
 }
 
-static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
+static int fdp1_pm_runtime_suspend(struct device *dev)
 {
 	struct fdp1_dev *fdp1 = dev_get_drvdata(dev);
 
@@ -2418,7 +2418,7 @@ static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused fdp1_pm_runtime_resume(struct device *dev)
+static int fdp1_pm_runtime_resume(struct device *dev)
 {
 	struct fdp1_dev *fdp1 = dev_get_drvdata(dev);
 
@@ -2429,9 +2429,7 @@ static int __maybe_unused fdp1_pm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops fdp1_pm_ops = {
-	SET_RUNTIME_PM_OPS(fdp1_pm_runtime_suspend,
-			   fdp1_pm_runtime_resume,
-			   NULL)
+	RUNTIME_PM_OPS(fdp1_pm_runtime_suspend, fdp1_pm_runtime_resume, NULL)
 };
 
 static const struct of_device_id fdp1_dt_ids[] = {
@@ -2446,7 +2444,7 @@ static struct platform_driver fdp1_pdrv = {
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = fdp1_dt_ids,
-		.pm	= &fdp1_pm_ops,
+		.pm	= pm_ptr(&fdp1_pm_ops),
 	},
 };
 
--

2.43.0

maintainer Reviewed-by on v1 3/5
#10 lore raw

Re: [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()

In reply to Geert Uytterhoeven

Hi Geert,

Quoted 6 lines · Geert Uytterhoeven

Convert the Renesas Fine Display Processor driver from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS() and pm_ptr(). This lets us drop the __maybe_unused annotations from its runtime suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

Quoted 46 lines
---
 drivers/media/platform/renesas/rcar_fdp1.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/media/platform/renesas/rcar_fdp1.c +4 -6
index 5d453a7a89889fa3..a40e48a7078f11b6 100644
@@ -2409,7 +2409,7 @@ static void fdp1_remove(struct platform_device *pdev)
 	rcar_fcp_put(fdp1->fcp);
 }
 
-static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
+static int fdp1_pm_runtime_suspend(struct device *dev)
 {
 	struct fdp1_dev *fdp1 = dev_get_drvdata(dev);
 
@@ -2418,7 +2418,7 @@ static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused fdp1_pm_runtime_resume(struct device *dev)
+static int fdp1_pm_runtime_resume(struct device *dev)
 {
 	struct fdp1_dev *fdp1 = dev_get_drvdata(dev);
 
@@ -2429,9 +2429,7 @@ static int __maybe_unused fdp1_pm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops fdp1_pm_ops = {
-	SET_RUNTIME_PM_OPS(fdp1_pm_runtime_suspend,
-			   fdp1_pm_runtime_resume,
-			   NULL)
+	RUNTIME_PM_OPS(fdp1_pm_runtime_suspend, fdp1_pm_runtime_resume, NULL)
 };
 
 static const struct of_device_id fdp1_dt_ids[] = {
@@ -2446,7 +2444,7 @@ static struct platform_driver fdp1_pdrv = {
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = fdp1_dt_ids,
-		.pm	= &fdp1_pm_ops,
+		.pm	= pm_ptr(&fdp1_pm_ops),
 	},
 };
 
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#11 lore raw

PATCH 4/5 media: renesas: ceu: Convert to RUNTIME_PM_OPS()

In reply to Geert Uytterhoeven

Convert the Renesas Capture Engine Unit driver from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS() and pm_ptr(). This lets us drop the __maybe_unused annotations from its runtime suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

---
 drivers/media/platform/renesas/renesas-ceu.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/media/platform/renesas/renesas-ceu.c +4 -6
index 8cceafe491b1bec6..deed49d0fb10e0d7 100644
@@ -1048,7 +1048,7 @@ static int ceu_init_mbus_fmt(struct ceu_device *ceudev)
 /*
  * ceu_runtime_resume() - soft-reset the interface and turn sensor power on.
  */
-static int __maybe_unused ceu_runtime_resume(struct device *dev)
+static int ceu_runtime_resume(struct device *dev)
 {
 	struct ceu_device *ceudev = dev_get_drvdata(dev);
 	struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1064,7 +1064,7 @@ static int __maybe_unused ceu_runtime_resume(struct device *dev)
  * ceu_runtime_suspend() - disable capture and interrupts and soft-reset.
  *			   Turn sensor power off.
  */
-static int __maybe_unused ceu_runtime_suspend(struct device *dev)
+static int ceu_runtime_suspend(struct device *dev)
 {
 	struct ceu_device *ceudev = dev_get_drvdata(dev);
 	struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1709,15 +1709,13 @@ static void ceu_remove(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops ceu_pm_ops = {
-	SET_RUNTIME_PM_OPS(ceu_runtime_suspend,
-			   ceu_runtime_resume,
-			   NULL)
+	RUNTIME_PM_OPS(ceu_runtime_suspend, ceu_runtime_resume, NULL)
 };
 
 static struct platform_driver ceu_driver = {
 	.driver		= {
 		.name	= DRIVER_NAME,
-		.pm	= &ceu_pm_ops,
+		.pm	= pm_ptr(&ceu_pm_ops),
 		.of_match_table = of_match_ptr(ceu_of_match),
 	},
 	.probe		= ceu_probe,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 4/5
#12 lore raw

RE: [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()

Quoted 10 lines

From: Geert Uytterhoeven <[email protected]>
Sent: 09 July 2025 20:16
To: Niklas Söderlund <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Fabrizio Castro <[email protected]>; Kieran Bingham <[email protected]>; Jacopo Mondi <[email protected]>; laurent.pinchart <[email protected]>
Cc: [email protected]; [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()

Quoted 6 lines

Convert the Renesas Capture Engine Unit driver from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS() and pm_ptr(). This lets us drop the __maybe_unused annotations from its runtime suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

Quoted 47 lines
---
 drivers/media/platform/renesas/renesas-ceu.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/media/platform/renesas/renesas- renamed from drivers/media/platform/renesas/renesas-ceu.c +0 -0

ceu.c
index 8cceafe491b1bec6..deed49d0fb10e0d7 100644

drivers/media/platform/renesas/renesas-ceu.c +4 -7
@@ -1048,7 +1048,7 @@ static int ceu_init_mbus_fmt(struct ceu_device *ceudev)
 /*
  * ceu_runtime_resume() - soft-reset the interface and turn sensor power on.
  */
-static int __maybe_unused ceu_runtime_resume(struct device *dev)
+static int ceu_runtime_resume(struct device *dev)
 {
 	struct ceu_device *ceudev = dev_get_drvdata(dev);
 	struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1064,7 +1064,7 @@ static int __maybe_unused ceu_runtime_resume(struct device *dev)
  * ceu_runtime_suspend() - disable capture and interrupts and soft-reset.
  *			   Turn sensor power off.
  */
-static int __maybe_unused ceu_runtime_suspend(struct device *dev)
+static int ceu_runtime_suspend(struct device *dev)
 {
 	struct ceu_device *ceudev = dev_get_drvdata(dev);
 	struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1709,15 +1709,13 @@ static void ceu_remove(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops ceu_pm_ops = {
-	SET_RUNTIME_PM_OPS(ceu_runtime_suspend,
-			   ceu_runtime_resume,
-			   NULL)
+	RUNTIME_PM_OPS(ceu_runtime_suspend, ceu_runtime_resume, NULL)
 };
 
 static struct platform_driver ceu_driver = {
 	.driver		= {
 		.name	= DRIVER_NAME,
-		.pm	= &ceu_pm_ops,
+		.pm	= pm_ptr(&ceu_pm_ops),
 		.of_match_table = of_match_ptr(ceu_of_match),
 	},
 	.probe		= ceu_probe,
--

2.43.0

maintainer Reviewed-by on v1 4/5
#13 lore raw

Re: [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()

In reply to Geert Uytterhoeven
Quoted 6 lines · Geert Uytterhoeven

Convert the Renesas Capture Engine Unit driver from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS() and pm_ptr(). This lets us drop the __maybe_unused annotations from its runtime suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

Quoted 44 lines
---
 drivers/media/platform/renesas/renesas-ceu.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/media/platform/renesas/renesas-ceu.c +4 -6
index 8cceafe491b1bec6..deed49d0fb10e0d7 100644
@@ -1048,7 +1048,7 @@ static int ceu_init_mbus_fmt(struct ceu_device *ceudev)
 /*
  * ceu_runtime_resume() - soft-reset the interface and turn sensor power on.
  */
-static int __maybe_unused ceu_runtime_resume(struct device *dev)
+static int ceu_runtime_resume(struct device *dev)
 {
 	struct ceu_device *ceudev = dev_get_drvdata(dev);
 	struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1064,7 +1064,7 @@ static int __maybe_unused ceu_runtime_resume(struct device *dev)
  * ceu_runtime_suspend() - disable capture and interrupts and soft-reset.
  *			   Turn sensor power off.
  */
-static int __maybe_unused ceu_runtime_suspend(struct device *dev)
+static int ceu_runtime_suspend(struct device *dev)
 {
 	struct ceu_device *ceudev = dev_get_drvdata(dev);
 	struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1709,15 +1709,13 @@ static void ceu_remove(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops ceu_pm_ops = {
-	SET_RUNTIME_PM_OPS(ceu_runtime_suspend,
-			   ceu_runtime_resume,
-			   NULL)
+	RUNTIME_PM_OPS(ceu_runtime_suspend, ceu_runtime_resume, NULL)
 };
 
 static struct platform_driver ceu_driver = {
 	.driver		= {
 		.name	= DRIVER_NAME,
-		.pm	= &ceu_pm_ops,
+		.pm	= pm_ptr(&ceu_pm_ops),
 		.of_match_table = of_match_ptr(ceu_of_match),
 	},
 	.probe		= ceu_probe,
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#14 lore raw

PATCH 5/5 media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()

In reply to Geert Uytterhoeven

Convert the Renesas VSP1 Video Processing Engine driver from SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() to SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS(), and pm_ptr(). This lets us drop the __maybe_unused annotations from its various suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/media/platform/renesas/vsp1/vsp1_drv.c +7 -7
index b8d06e88c4757317..6c64657fc4f3366f 100644
@@ -618,7 +618,7 @@ void vsp1_device_put(struct vsp1_device *vsp1)
  * Power Management
  */
 
-static int __maybe_unused vsp1_pm_suspend(struct device *dev)
+static int vsp1_pm_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -634,7 +634,7 @@ static int __maybe_unused vsp1_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_resume(struct device *dev)
+static int vsp1_pm_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -650,7 +650,7 @@ static int __maybe_unused vsp1_pm_resume(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
+static int vsp1_pm_runtime_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -660,7 +660,7 @@ static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
+static int vsp1_pm_runtime_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 	int ret;
@@ -693,8 +693,8 @@ static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops vsp1_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
-	SET_RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
+	RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
 };
 
 /* -----------------------------------------------------------------------------
@@ -1042,7 +1042,7 @@ static struct platform_driver vsp1_platform_driver = {
 	.remove		= vsp1_remove,
 	.driver		= {
 		.name	= "vsp1",
-		.pm	= &vsp1_pm_ops,
+		.pm	= pm_ptr(&vsp1_pm_ops),
 		.of_match_table = vsp1_of_match,
 	},
 };
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 5/5
#15 lore raw

RE: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()

Quoted 10 lines

From: Geert Uytterhoeven <[email protected]>
Sent: 09 July 2025 20:16
To: Niklas Söderlund <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Fabrizio Castro <[email protected]>; Kieran Bingham <[email protected]>; Jacopo Mondi <[email protected]>; laurent.pinchart <[email protected]>
Cc: [email protected]; [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()

Quoted 7 lines

Convert the Renesas VSP1 Video Processing Engine driver from SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() to SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS(), and pm_ptr(). This lets us drop the __maybe_unused annotations from its various suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

Quoted 67 lines
---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/media/platform/renesas/vsp1/vsp1_drv.c +7 -8
index b8d06e88c4757317..6c64657fc4f3366f 100644
@@ -618,7 +618,7 @@ void vsp1_device_put(struct vsp1_device *vsp1)
  * Power Management
  */
 
-static int __maybe_unused vsp1_pm_suspend(struct device *dev)
+static int vsp1_pm_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -634,7 +634,7 @@ static int __maybe_unused vsp1_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_resume(struct device *dev)
+static int vsp1_pm_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -650,7 +650,7 @@ static int __maybe_unused vsp1_pm_resume(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
+static int vsp1_pm_runtime_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -660,7 +660,7 @@ static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
+static int vsp1_pm_runtime_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 	int ret;
@@ -693,8 +693,8 @@ static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops vsp1_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
-	SET_RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
+	RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
 };
 
 /* -----------------------------------------------------------------------------
@@ -1042,7 +1042,7 @@ static struct platform_driver vsp1_platform_driver = {
 	.remove		= vsp1_remove,
 	.driver		= {
 		.name	= "vsp1",
-		.pm	= &vsp1_pm_ops,
+		.pm	= pm_ptr(&vsp1_pm_ops),
 		.of_match_table = vsp1_of_match,
 	},
 };
--

2.43.0

Reviewed-by on v1 5/5
#16 lore raw

Re: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()

In reply to Geert Uytterhoeven

Hi Geert

Quoted 7 lines · Geert Uytterhoeven

Convert the Renesas VSP1 Video Processing Engine driver from SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() to SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS(), and pm_ptr(). This lets us drop the __maybe_unused annotations from its various suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

Quoted 67 lines
---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/media/platform/renesas/vsp1/vsp1_drv.c +7 -8
index b8d06e88c4757317..6c64657fc4f3366f 100644
@@ -618,7 +618,7 @@ void vsp1_device_put(struct vsp1_device *vsp1)
  * Power Management
  */
 
-static int __maybe_unused vsp1_pm_suspend(struct device *dev)
+static int vsp1_pm_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -634,7 +634,7 @@ static int __maybe_unused vsp1_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_resume(struct device *dev)
+static int vsp1_pm_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -650,7 +650,7 @@ static int __maybe_unused vsp1_pm_resume(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
+static int vsp1_pm_runtime_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -660,7 +660,7 @@ static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
+static int vsp1_pm_runtime_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 	int ret;
@@ -693,8 +693,8 @@ static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops vsp1_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
-	SET_RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
+	RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
 };
 
 /* -----------------------------------------------------------------------------
@@ -1042,7 +1042,7 @@ static struct platform_driver vsp1_platform_driver = {
 	.remove		= vsp1_remove,
 	.driver		= {
 		.name	= "vsp1",
-		.pm	= &vsp1_pm_ops,
+		.pm	= pm_ptr(&vsp1_pm_ops),
 		.of_match_table = vsp1_of_match,
 	},
 };
--

2.43.0

maintainer Reviewed-by on v1 5/5
#17 lore raw

Re: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()

In reply to Geert Uytterhoeven

Hi Geert,

Thank you for the patch.

Quoted 7 lines · Geert Uytterhoeven

Convert the Renesas VSP1 Video Processing Engine driver from SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() to SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS(), and pm_ptr(). This lets us drop the __maybe_unused annotations from its various suspend and resume callbacks, and reduces kernel size in case CONFIG_PM is disabled.

Quoted 64 lines
---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/media/platform/renesas/vsp1/vsp1_drv.c +7 -7
index b8d06e88c4757317..6c64657fc4f3366f 100644
@@ -618,7 +618,7 @@ void vsp1_device_put(struct vsp1_device *vsp1)
  * Power Management
  */
 
-static int __maybe_unused vsp1_pm_suspend(struct device *dev)
+static int vsp1_pm_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -634,7 +634,7 @@ static int __maybe_unused vsp1_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_resume(struct device *dev)
+static int vsp1_pm_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -650,7 +650,7 @@ static int __maybe_unused vsp1_pm_resume(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
+static int vsp1_pm_runtime_suspend(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 
@@ -660,7 +660,7 @@ static int __maybe_unused vsp1_pm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
+static int vsp1_pm_runtime_resume(struct device *dev)
 {
 	struct vsp1_device *vsp1 = dev_get_drvdata(dev);
 	int ret;
@@ -693,8 +693,8 @@ static int __maybe_unused vsp1_pm_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops vsp1_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
-	SET_RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(vsp1_pm_suspend, vsp1_pm_resume)
+	RUNTIME_PM_OPS(vsp1_pm_runtime_suspend, vsp1_pm_runtime_resume, NULL)
 };
 
 /* -----------------------------------------------------------------------------
@@ -1042,7 +1042,7 @@ static struct platform_driver vsp1_platform_driver = {
 	.remove		= vsp1_remove,
 	.driver		= {
 		.name	= "vsp1",
-		.pm	= &vsp1_pm_ops,
+		.pm	= pm_ptr(&vsp1_pm_ops),
 		.of_match_table = vsp1_of_match,
 	},
 };
Signature · 3 lines
Regards,

Laurent Pinchart
maintainer
#18 lore raw
In reply to Geert Uytterhoeven
Quoted 9 lines · Geert Uytterhoeven

Hi all,

This patch series converts the Renesas media drivers from the old SIMPLE_DEV_PM_OPS(), SET_SYSTEM_SLEEP_PM_OPS(), and SET_RUNTIME_PM_OPS() helpers to the modern DEFINE_SIMPLE_DEV_PM_OPS(), SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS(), pm_ptr(), and pm_sleep_ptr() helpers. This lets us drop the __maybe_unused annotations from power management callbacks, and reduces kernel size in case power management or sleep support is not enabled.

There is lots of cargo-cult in drivers when it comes to PM. Cleaning things up is good, but we also need to document the recommended usage. SIMPLE_DEV_PM_OPS() is marked as deprecated, but SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() are not. Usage of pm_ptr is also not documented. Could you send a documentation patch to address this ?

Quoted 15 lines

Thanks for your comments!

Geert Uytterhoeven (5):
media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
media: renesas: ceu: Convert to RUNTIME_PM_OPS()
media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()

 .../media/platform/renesas/rcar-vin/rcar-core.c    |  8 ++++----
 drivers/media/platform/renesas/rcar_drif.c         | 10 +++++-----
 drivers/media/platform/renesas/rcar_fdp1.c         | 10 ++++------
 drivers/media/platform/renesas/renesas-ceu.c       | 10 ++++------
 drivers/media/platform/renesas/vsp1/vsp1_drv.c     | 14 +++++++-------
 5 files changed, 24 insertions(+), 28 deletions(-)
Signature · 3 lines
Regards,

Laurent Pinchart