media: renesas: Convert to modern *_PM_OPS()
Subsystems (7)
Geert Uytterhoeven
maintainercover 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 TorvaldsGeert Uytterhoeven
maintainerPATCH 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
@@ -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
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 toDEFINE_SIMPLE_DEV_PM_OPS()
Quoted 7 lines
Convert the Renesas Digital Radio Interface driver from
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). This lets us drop the__maybe_unusedannotations from its suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Re: [PATCH 1/5] media: renesas: rcar_drif: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
In reply to Geert UytterhoevenQuoted 39 lines · Geert Uytterhoeven
Convert the Renesas Digital Radio Interface driver from
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). This lets us drop the__maybe_unusedannotations from its suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>--- drivers/media/platform/renesas/rcar_drif.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/media/platform/renesas/rcar_drif.c +4
-4@@ -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
Geert Uytterhoeven
maintainerPATCH 2/5 media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
In reply to Geert UytterhoevenConvert 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
@@ -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
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 toDEFINE_SIMPLE_DEV_PM_OPS()
Quoted 6 lines
Convert the Renesas R-Car Video Input driver from
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). This lets us drop the__maybe_unusedannotations from its suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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
indexf73729f59671be20..100105b620e31e58100644drivers/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
Re: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
In reply to Geert UytterhoevenHi Geert,
Thanks for your work.
Quoted 6 lines · Geert Uytterhoeven
Convert the Renesas R-Car Video Input driver from
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). This lets us drop the__maybe_unusedannotations from its suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Re: [PATCH 2/5] media: renesas: rcar-vin: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
In reply to Geert UytterhoevenHi Geert,
Thank you for the patch.
Quoted 6 lines · Geert Uytterhoeven
Convert the Renesas R-Car Video Input driver from
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). This lets us drop the__maybe_unusedannotations from its suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Geert Uytterhoeven
maintainerPATCH 3/5 media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
In reply to Geert UytterhoevenConvert 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
@@ -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
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 toRUNTIME_PM_OPS()
Quoted 6 lines
Convert the Renesas Fine Display Processor driver from
SET_RUNTIME_PM_OPS()toRUNTIME_PM_OPS()andpm_ptr(). This lets us drop the__maybe_unusedannotations from its runtime suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Re: [PATCH 3/5] media: renesas: fdp1: Convert to RUNTIME_PM_OPS()
In reply to Geert UytterhoevenHi Geert,
Quoted 6 lines · Geert Uytterhoeven
Convert the Renesas Fine Display Processor driver from
SET_RUNTIME_PM_OPS()toRUNTIME_PM_OPS()andpm_ptr(). This lets us drop the__maybe_unusedannotations from its runtime suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Geert Uytterhoeven
maintainerPATCH 4/5 media: renesas: ceu: Convert to RUNTIME_PM_OPS()
In reply to Geert UytterhoevenConvert 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
@@ -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
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 toRUNTIME_PM_OPS()
Quoted 6 lines
Convert the Renesas Capture Engine Unit driver from
SET_RUNTIME_PM_OPS()toRUNTIME_PM_OPS()andpm_ptr(). This lets us drop the__maybe_unusedannotations from its runtime suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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
index8cceafe491b1bec6..deed49d0fb10e0d7100644drivers/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
Re: [PATCH 4/5] media: renesas: ceu: Convert to RUNTIME_PM_OPS()
In reply to Geert UytterhoevenQuoted 6 lines · Geert Uytterhoeven
Convert the Renesas Capture Engine Unit driver from
SET_RUNTIME_PM_OPS()toRUNTIME_PM_OPS()andpm_ptr(). This lets us drop the__maybe_unusedannotations from its runtime suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Geert Uytterhoeven
maintainerPATCH 5/5 media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
In reply to Geert UytterhoevenConvert 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
@@ -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
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()andSET_RUNTIME_PM_OPS()toSYSTEM_SLEEP_PM_OPS(),RUNTIME_PM_OPS(), andpm_ptr(). This lets us drop the__maybe_unusedannotations from its various suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Re: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
In reply to Geert UytterhoevenHi Geert
Quoted 7 lines · Geert Uytterhoeven
Convert the Renesas VSP1 Video Processing Engine driver from
SET_SYSTEM_SLEEP_PM_OPS()andSET_RUNTIME_PM_OPS()toSYSTEM_SLEEP_PM_OPS(),RUNTIME_PM_OPS(), andpm_ptr(). This lets us drop the__maybe_unusedannotations from its various suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Re: [PATCH 5/5] media: renesas: vsp1: Convert to SYSTEM_SLEEP/RUNTIME_PM_OPS()
In reply to Geert UytterhoevenHi 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()andSET_RUNTIME_PM_OPS()toSYSTEM_SLEEP_PM_OPS(),RUNTIME_PM_OPS(), andpm_ptr(). This lets us drop the__maybe_unusedannotations from its various suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMis disabled.Signed-off-by Geert Uytterhoeven <[email protected]>
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@@ -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
Laurent Pinchart
maintainerQuoted 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(), andSET_RUNTIME_PM_OPS()helpers to the modernDEFINE_SIMPLE_DEV_PM_OPS(),SYSTEM_SLEEP_PM_OPS(),RUNTIME_PM_OPS(),pm_ptr(), andpm_sleep_ptr()helpers. This lets us drop the__maybe_unusedannotations 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 toDEFINE_SIMPLE_DEV_PM_OPS()
media: renesas: rcar-vin: Convert toDEFINE_SIMPLE_DEV_PM_OPS()
media: renesas: fdp1: Convert toRUNTIME_PM_OPS()
media: renesas: ceu: Convert toRUNTIME_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