linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS()
@ 2025-07-09 19:16 Geert Uytterhoeven
  2025-07-09 19:16 ` [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2025-07-09 19:16 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, Laurent Pinchart
  Cc: linux-media, linux-renesas-soc, 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.

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(-)

-- 
2.43.0

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] 19+ messages in thread

* [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:16 [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Geert Uytterhoeven
@ 2025-07-09 19:16 ` Geert Uytterhoeven
  2025-07-10 11:13   ` Fabrizio Castro
  2025-07-10 23:09   ` Laurent Pinchart
  2025-07-09 19:16 ` [PATCH 2/5] media: renesas: rcar-vin: " Geert Uytterhoeven
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2025-07-09 19:16 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, Laurent Pinchart
  Cc: linux-media, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/media/platform/renesas/rcar_drif.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c
index fc8b6bbef793c64e..0f0c5844e22ea86c 100644
--- a/drivers/media/platform/renesas/rcar_drif.c
+++ b/drivers/media/platform/renesas/rcar_drif.c
@@ -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


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

* [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:16 [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Geert Uytterhoeven
  2025-07-09 19:16 ` [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
@ 2025-07-09 19:16 ` Geert Uytterhoeven
  2025-07-10 11:13   ` Fabrizio Castro
                     ` (2 more replies)
  2025-07-09 19:16 ` [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS() Geert Uytterhoeven
                   ` (3 subsequent siblings)
  5 siblings, 3 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2025-07-09 19:16 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, Laurent Pinchart
  Cc: linux-media, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
index f73729f59671be20..100105b620e31e58 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
@@ -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


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

* [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
  2025-07-09 19:16 [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Geert Uytterhoeven
  2025-07-09 19:16 ` [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
  2025-07-09 19:16 ` [PATCH 2/5] media: renesas: rcar-vin: " Geert Uytterhoeven
@ 2025-07-09 19:16 ` Geert Uytterhoeven
  2025-07-10 11:14   ` Fabrizio Castro
  2025-07-10 23:16   ` Laurent Pinchart
  2025-07-09 19:16 ` [PATCH 4/5] media: renesas: ceu: " Geert Uytterhoeven
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2025-07-09 19:16 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, Laurent Pinchart
  Cc: linux-media, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/media/platform/renesas/rcar_fdp1.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
index 5d453a7a89889fa3..a40e48a7078f11b6 100644
--- a/drivers/media/platform/renesas/rcar_fdp1.c
+++ b/drivers/media/platform/renesas/rcar_fdp1.c
@@ -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


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

* [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()
  2025-07-09 19:16 [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2025-07-09 19:16 ` [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS() Geert Uytterhoeven
@ 2025-07-09 19:16 ` Geert Uytterhoeven
  2025-07-10 11:14   ` Fabrizio Castro
  2025-07-10 23:20   ` Laurent Pinchart
  2025-07-09 19:16 ` [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS() Geert Uytterhoeven
  2025-07-10 23:24 ` [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Laurent Pinchart
  5 siblings, 2 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2025-07-09 19:16 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, Laurent Pinchart
  Cc: linux-media, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/media/platform/renesas/renesas-ceu.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
index 8cceafe491b1bec6..deed49d0fb10e0d7 100644
--- a/drivers/media/platform/renesas/renesas-ceu.c
+++ b/drivers/media/platform/renesas/renesas-ceu.c
@@ -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


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

* [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
  2025-07-09 19:16 [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2025-07-09 19:16 ` [PATCH 4/5] media: renesas: ceu: " Geert Uytterhoeven
@ 2025-07-09 19:16 ` Geert Uytterhoeven
  2025-07-10 11:15   ` Fabrizio Castro
                     ` (2 more replies)
  2025-07-10 23:24 ` [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Laurent Pinchart
  5 siblings, 3 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2025-07-09 19:16 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, Laurent Pinchart
  Cc: linux-media, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
index b8d06e88c4757317..6c64657fc4f3366f 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
@@ -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


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

* RE: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:16 ` [PATCH 2/5] media: renesas: rcar-vin: " Geert Uytterhoeven
@ 2025-07-10 11:13   ` Fabrizio Castro
  2025-07-10 13:02   ` Niklas Söderlund
  2025-07-10 23:10   ` Laurent Pinchart
  2 siblings, 0 replies; 19+ messages in thread
From: Fabrizio Castro @ 2025-07-10 11:13 UTC (permalink / raw)
  To: Geert Uytterhoeven, Niklas Söderlund, Mauro Carvalho Chehab,
	Kieran Bingham, Jacopo Mondi, laurent.pinchart
  Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org

> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: 09 July 2025 20:16
> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>; Mauro Carvalho Chehab <mchehab@kernel.org>;
> Fabrizio Castro <fabrizio.castro.jz@renesas.com>; Kieran Bingham
> <kieran.bingham+renesas@ideasonboard.com>; Jacopo Mondi <jacopo@jmondi.org>; laurent.pinchart
> <laurent.pinchart@ideasonboard.com>
> Cc: linux-media@vger.kernel.org; linux-renesas-soc@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>
> Subject: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
> 
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>

> ---
>  drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-
> vin/rcar-core.c
> index f73729f59671be20..100105b620e31e58 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> @@ -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


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

* RE: [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:16 ` [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
@ 2025-07-10 11:13   ` Fabrizio Castro
  2025-07-10 23:09   ` Laurent Pinchart
  1 sibling, 0 replies; 19+ messages in thread
From: Fabrizio Castro @ 2025-07-10 11:13 UTC (permalink / raw)
  To: Geert Uytterhoeven, Niklas Söderlund, Mauro Carvalho Chehab,
	Kieran Bingham, Jacopo Mondi, laurent.pinchart
  Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org

> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: 09 July 2025 20:16
> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>; Mauro Carvalho Chehab <mchehab@kernel.org>;
> Fabrizio Castro <fabrizio.castro.jz@renesas.com>; Kieran Bingham
> <kieran.bingham+renesas@ideasonboard.com>; Jacopo Mondi <jacopo@jmondi.org>; laurent.pinchart
> <laurent.pinchart@ideasonboard.com>
> Cc: linux-media@vger.kernel.org; linux-renesas-soc@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>
> Subject: [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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>

> ---
>  drivers/media/platform/renesas/rcar_drif.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c
> index fc8b6bbef793c64e..0f0c5844e22ea86c 100644
> --- a/drivers/media/platform/renesas/rcar_drif.c
> +++ b/drivers/media/platform/renesas/rcar_drif.c
> @@ -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
> 


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

* RE: [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
  2025-07-09 19:16 ` [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS() Geert Uytterhoeven
@ 2025-07-10 11:14   ` Fabrizio Castro
  2025-07-10 23:16   ` Laurent Pinchart
  1 sibling, 0 replies; 19+ messages in thread
From: Fabrizio Castro @ 2025-07-10 11:14 UTC (permalink / raw)
  To: Geert Uytterhoeven, Niklas Söderlund, Mauro Carvalho Chehab,
	Kieran Bingham, Jacopo Mondi, laurent.pinchart
  Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org

> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: 09 July 2025 20:16
> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>; Mauro Carvalho Chehab <mchehab@kernel.org>;
> Fabrizio Castro <fabrizio.castro.jz@renesas.com>; Kieran Bingham
> <kieran.bingham+renesas@ideasonboard.com>; Jacopo Mondi <jacopo@jmondi.org>; laurent.pinchart
> <laurent.pinchart@ideasonboard.com>
> Cc: linux-media@vger.kernel.org; linux-renesas-soc@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>
> Subject: [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
> 
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>

> ---
>  drivers/media/platform/renesas/rcar_fdp1.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
> index 5d453a7a89889fa3..a40e48a7078f11b6 100644
> --- a/drivers/media/platform/renesas/rcar_fdp1.c
> +++ b/drivers/media/platform/renesas/rcar_fdp1.c
> @@ -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


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

* RE: [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()
  2025-07-09 19:16 ` [PATCH 4/5] media: renesas: ceu: " Geert Uytterhoeven
@ 2025-07-10 11:14   ` Fabrizio Castro
  2025-07-10 23:20   ` Laurent Pinchart
  1 sibling, 0 replies; 19+ messages in thread
From: Fabrizio Castro @ 2025-07-10 11:14 UTC (permalink / raw)
  To: Geert Uytterhoeven, Niklas Söderlund, Mauro Carvalho Chehab,
	Kieran Bingham, Jacopo Mondi, laurent.pinchart
  Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org

> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: 09 July 2025 20:16
> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>; Mauro Carvalho Chehab <mchehab@kernel.org>;
> Fabrizio Castro <fabrizio.castro.jz@renesas.com>; Kieran Bingham
> <kieran.bingham+renesas@ideasonboard.com>; Jacopo Mondi <jacopo@jmondi.org>; laurent.pinchart
> <laurent.pinchart@ideasonboard.com>
> Cc: linux-media@vger.kernel.org; linux-renesas-soc@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>
> Subject: [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()
> 
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>

> ---
>  drivers/media/platform/renesas/renesas-ceu.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-
> ceu.c
> index 8cceafe491b1bec6..deed49d0fb10e0d7 100644
> --- a/drivers/media/platform/renesas/renesas-ceu.c
> +++ b/drivers/media/platform/renesas/renesas-ceu.c
> @@ -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


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

* RE: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
  2025-07-09 19:16 ` [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS() Geert Uytterhoeven
@ 2025-07-10 11:15   ` Fabrizio Castro
  2025-07-10 13:51   ` Jacopo Mondi
  2025-07-10 23:22   ` Laurent Pinchart
  2 siblings, 0 replies; 19+ messages in thread
From: Fabrizio Castro @ 2025-07-10 11:15 UTC (permalink / raw)
  To: Geert Uytterhoeven, Niklas Söderlund, Mauro Carvalho Chehab,
	Kieran Bingham, Jacopo Mondi, laurent.pinchart
  Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org

> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: 09 July 2025 20:16
> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>; Mauro Carvalho Chehab <mchehab@kernel.org>;
> Fabrizio Castro <fabrizio.castro.jz@renesas.com>; Kieran Bingham
> <kieran.bingham+renesas@ideasonboard.com>; Jacopo Mondi <jacopo@jmondi.org>; laurent.pinchart
> <laurent.pinchart@ideasonboard.com>
> Cc: linux-media@vger.kernel.org; linux-renesas-soc@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>
> Subject: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
> 
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>

> ---
>  drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index b8d06e88c4757317..6c64657fc4f3366f 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -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


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

* Re: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:16 ` [PATCH 2/5] media: renesas: rcar-vin: " Geert Uytterhoeven
  2025-07-10 11:13   ` Fabrizio Castro
@ 2025-07-10 13:02   ` Niklas Söderlund
  2025-07-10 23:10   ` Laurent Pinchart
  2 siblings, 0 replies; 19+ messages in thread
From: Niklas Söderlund @ 2025-07-10 13:02 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mauro Carvalho Chehab, Fabrizio Castro, Kieran Bingham,
	Jacopo Mondi, Laurent Pinchart, linux-media, linux-renesas-soc

Hi Geert,

Thanks for your work.

On 2025-07-09 21:16:08 +0200, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> index f73729f59671be20..100105b620e31e58 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> @@ -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
> 

-- 
Kind Regards,
Niklas Söderlund

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

* Re: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
  2025-07-09 19:16 ` [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS() Geert Uytterhoeven
  2025-07-10 11:15   ` Fabrizio Castro
@ 2025-07-10 13:51   ` Jacopo Mondi
  2025-07-10 23:22   ` Laurent Pinchart
  2 siblings, 0 replies; 19+ messages in thread
From: Jacopo Mondi @ 2025-07-10 13:51 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, Laurent Pinchart, linux-media,
	linux-renesas-soc

Hi Geert

On Wed, Jul 09, 2025 at 09:16:11PM +0200, Geert Uytterhoeven wrote:
> 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.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index b8d06e88c4757317..6c64657fc4f3366f 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -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
>

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

* Re: [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:16 ` [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
  2025-07-10 11:13   ` Fabrizio Castro
@ 2025-07-10 23:09   ` Laurent Pinchart
  1 sibling, 0 replies; 19+ messages in thread
From: Laurent Pinchart @ 2025-07-10 23:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, linux-media, linux-renesas-soc

On Wed, Jul 09, 2025 at 09:16:07PM +0200, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  drivers/media/platform/renesas/rcar_drif.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c
> index fc8b6bbef793c64e..0f0c5844e22ea86c 100644
> --- a/drivers/media/platform/renesas/rcar_drif.c
> +++ b/drivers/media/platform/renesas/rcar_drif.c
> @@ -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),
>  		},

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

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>


>  	.probe = rcar_drif_probe,
>  	.remove = rcar_drif_remove,

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:16 ` [PATCH 2/5] media: renesas: rcar-vin: " Geert Uytterhoeven
  2025-07-10 11:13   ` Fabrizio Castro
  2025-07-10 13:02   ` Niklas Söderlund
@ 2025-07-10 23:10   ` Laurent Pinchart
  2 siblings, 0 replies; 19+ messages in thread
From: Laurent Pinchart @ 2025-07-10 23:10 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, linux-media, linux-renesas-soc

Hi Geert,

Thank you for the patch.

On Wed, Jul 09, 2025 at 09:16:08PM +0200, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/rcar-vin/rcar-core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> index f73729f59671be20..100105b620e31e58 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> @@ -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,

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
  2025-07-09 19:16 ` [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS() Geert Uytterhoeven
  2025-07-10 11:14   ` Fabrizio Castro
@ 2025-07-10 23:16   ` Laurent Pinchart
  1 sibling, 0 replies; 19+ messages in thread
From: Laurent Pinchart @ 2025-07-10 23:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, linux-media, linux-renesas-soc

Hi Geert,

On Wed, Jul 09, 2025 at 09:16:09PM +0200, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/rcar_fdp1.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
> index 5d453a7a89889fa3..a40e48a7078f11b6 100644
> --- a/drivers/media/platform/renesas/rcar_fdp1.c
> +++ b/drivers/media/platform/renesas/rcar_fdp1.c
> @@ -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),
>  	},
>  };
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()
  2025-07-09 19:16 ` [PATCH 4/5] media: renesas: ceu: " Geert Uytterhoeven
  2025-07-10 11:14   ` Fabrizio Castro
@ 2025-07-10 23:20   ` Laurent Pinchart
  1 sibling, 0 replies; 19+ messages in thread
From: Laurent Pinchart @ 2025-07-10 23:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, linux-media, linux-renesas-soc

On Wed, Jul 09, 2025 at 09:16:10PM +0200, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/renesas-ceu.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
> index 8cceafe491b1bec6..deed49d0fb10e0d7 100644
> --- a/drivers/media/platform/renesas/renesas-ceu.c
> +++ b/drivers/media/platform/renesas/renesas-ceu.c
> @@ -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,

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
  2025-07-09 19:16 ` [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS() Geert Uytterhoeven
  2025-07-10 11:15   ` Fabrizio Castro
  2025-07-10 13:51   ` Jacopo Mondi
@ 2025-07-10 23:22   ` Laurent Pinchart
  2 siblings, 0 replies; 19+ messages in thread
From: Laurent Pinchart @ 2025-07-10 23:22 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, linux-media, linux-renesas-soc

Hi Geert,

Thank you for the patch.

On Wed, Jul 09, 2025 at 09:16:11PM +0200, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/vsp1/vsp1_drv.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index b8d06e88c4757317..6c64657fc4f3366f 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -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,
>  	},
>  };

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS()
  2025-07-09 19:16 [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2025-07-09 19:16 ` [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS() Geert Uytterhoeven
@ 2025-07-10 23:24 ` Laurent Pinchart
  5 siblings, 0 replies; 19+ messages in thread
From: Laurent Pinchart @ 2025-07-10 23:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, Fabrizio Castro,
	Kieran Bingham, Jacopo Mondi, linux-media, linux-renesas-soc

On Wed, Jul 09, 2025 at 09:16:06PM +0200, Geert Uytterhoeven wrote:
> 	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 ?

> 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(-)

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2025-07-10 23:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 19:16 [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Geert Uytterhoeven
2025-07-09 19:16 ` [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
2025-07-10 11:13   ` Fabrizio Castro
2025-07-10 23:09   ` Laurent Pinchart
2025-07-09 19:16 ` [PATCH 2/5] media: renesas: rcar-vin: " Geert Uytterhoeven
2025-07-10 11:13   ` Fabrizio Castro
2025-07-10 13:02   ` Niklas Söderlund
2025-07-10 23:10   ` Laurent Pinchart
2025-07-09 19:16 ` [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS() Geert Uytterhoeven
2025-07-10 11:14   ` Fabrizio Castro
2025-07-10 23:16   ` Laurent Pinchart
2025-07-09 19:16 ` [PATCH 4/5] media: renesas: ceu: " Geert Uytterhoeven
2025-07-10 11:14   ` Fabrizio Castro
2025-07-10 23:20   ` Laurent Pinchart
2025-07-09 19:16 ` [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS() Geert Uytterhoeven
2025-07-10 11:15   ` Fabrizio Castro
2025-07-10 13:51   ` Jacopo Mondi
2025-07-10 23:22   ` Laurent Pinchart
2025-07-10 23:24 ` [PATCH 0/5] media: renesas: Convert to modern *_PM_OPS() Laurent Pinchart

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).