* [PATCH 1/3] media: rkvdec: Switch to modern PM_OPS
2026-10-01 17:34 [PATCH 0/3] media: rockchip: Modernize PM_OPS Diederik de Haas
@ 2026-10-01 17:34 ` Diederik de Haas
2026-10-01 17:34 ` [PATCH 2/3] media: rockchip: rga: " Diederik de Haas
2026-10-01 17:34 ` [PATCH 3/3] media: rkisp1: " Diederik de Haas
2 siblings, 0 replies; 5+ messages in thread
From: Diederik de Haas @ 2026-10-01 17:34 UTC (permalink / raw)
To: Dafna Hirschfeld, Laurent Pinchart, Mauro Carvalho Chehab,
Heiko Stuebner, Detlev Casanova, Ezequiel Garcia, Jacob Chen
Cc: linux-media, linux-rockchip, linux-arm-kernel, linux-kernel,
Diederik de Haas
A new set of modern PM_OPS macros got defined in commit
1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones")
Switch to those new macros so that the PM callbacks are always seen by the
compiler, but discarded if not used. This lets us drop the check for
CONFIG_PM.
Signed-off-by: Diederik de Haas <diederik@cknow-tech.com>
---
drivers/media/platform/rockchip/rkvdec/rkvdec.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
index 061281f903f3..936abd92f703 100644
--- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
+++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
@@ -1877,7 +1877,6 @@ static void rkvdec_remove(struct platform_device *pdev)
iommu_domain_free(rkvdec->empty_domain);
}
-#ifdef CONFIG_PM
static int rkvdec_runtime_resume(struct device *dev)
{
struct rkvdec_dev *rkvdec = dev_get_drvdata(dev);
@@ -1892,12 +1891,10 @@ static int rkvdec_runtime_suspend(struct device *dev)
clk_bulk_disable_unprepare(rkvdec->num_clocks, rkvdec->clocks);
return 0;
}
-#endif
static const struct dev_pm_ops rkvdec_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
- SET_RUNTIME_PM_OPS(rkvdec_runtime_suspend, rkvdec_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+ RUNTIME_PM_OPS(rkvdec_runtime_suspend, rkvdec_runtime_resume, NULL)
};
static struct platform_driver rkvdec_driver = {
@@ -1906,7 +1903,7 @@ static struct platform_driver rkvdec_driver = {
.driver = {
.name = "rkvdec",
.of_match_table = of_rkvdec_match,
- .pm = &rkvdec_pm_ops,
+ .pm = pm_ptr(&rkvdec_pm_ops),
},
};
module_platform_driver(rkvdec_driver);
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/3] media: rockchip: rga: Switch to modern PM_OPS
2026-10-01 17:34 [PATCH 0/3] media: rockchip: Modernize PM_OPS Diederik de Haas
2026-10-01 17:34 ` [PATCH 1/3] media: rkvdec: Switch to modern PM_OPS Diederik de Haas
@ 2026-10-01 17:34 ` Diederik de Haas
2026-10-01 17:34 ` [PATCH 3/3] media: rkisp1: " Diederik de Haas
2 siblings, 0 replies; 5+ messages in thread
From: Diederik de Haas @ 2026-10-01 17:34 UTC (permalink / raw)
To: Dafna Hirschfeld, Laurent Pinchart, Mauro Carvalho Chehab,
Heiko Stuebner, Detlev Casanova, Ezequiel Garcia, Jacob Chen
Cc: linux-media, linux-rockchip, linux-arm-kernel, linux-kernel,
Diederik de Haas
A new set of modern PM_OPS macros got defined in commit
1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones")
Switch to those new macros so that the PM callbacks are always seen by the
compiler, but discarded if not used. This lets us drop the __maybe_unused
annotation from the callback functions.
Signed-off-by: Diederik de Haas <diederik@cknow-tech.com>
---
drivers/media/platform/rockchip/rga/rga.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
index b3cb6bf8eb86..f28c93d63760 100644
--- a/drivers/media/platform/rockchip/rga/rga.c
+++ b/drivers/media/platform/rockchip/rga/rga.c
@@ -883,7 +883,7 @@ static void rga_remove(struct platform_device *pdev)
pm_runtime_disable(rga->dev);
}
-static int __maybe_unused rga_runtime_suspend(struct device *dev)
+static int rga_runtime_suspend(struct device *dev)
{
struct rockchip_rga *rga = dev_get_drvdata(dev);
@@ -892,7 +892,7 @@ static int __maybe_unused rga_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused rga_runtime_resume(struct device *dev)
+static int rga_runtime_resume(struct device *dev)
{
struct rockchip_rga *rga = dev_get_drvdata(dev);
@@ -900,8 +900,7 @@ static int __maybe_unused rga_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops rga_pm = {
- SET_RUNTIME_PM_OPS(rga_runtime_suspend,
- rga_runtime_resume, NULL)
+ RUNTIME_PM_OPS(rga_runtime_suspend, rga_runtime_resume, NULL)
};
static const struct of_device_id rockchip_rga_match[] = {
@@ -927,7 +926,7 @@ static struct platform_driver rga_pdrv = {
.remove = rga_remove,
.driver = {
.name = RGA_NAME,
- .pm = &rga_pm,
+ .pm = pm_ptr(&rga_pm),
.of_match_table = rockchip_rga_match,
},
};
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 3/3] media: rkisp1: Switch to modern PM_OPS
2026-10-01 17:34 [PATCH 0/3] media: rockchip: Modernize PM_OPS Diederik de Haas
2026-10-01 17:34 ` [PATCH 1/3] media: rkvdec: Switch to modern PM_OPS Diederik de Haas
2026-10-01 17:34 ` [PATCH 2/3] media: rockchip: rga: " Diederik de Haas
@ 2026-10-01 17:34 ` Diederik de Haas
2026-10-02 1:46 ` Laurent Pinchart
2 siblings, 1 reply; 5+ messages in thread
From: Diederik de Haas @ 2026-10-01 17:34 UTC (permalink / raw)
To: Dafna Hirschfeld, Laurent Pinchart, Mauro Carvalho Chehab,
Heiko Stuebner, Detlev Casanova, Ezequiel Garcia, Jacob Chen
Cc: linux-media, linux-rockchip, linux-arm-kernel, linux-kernel,
Diederik de Haas
A new set of modern PM_OPS macros got defined in commit
1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones")
Switch to those new macros so that the PM callbacks are always seen by the
compiler, but discarded if not used. This lets us drop the __maybe_unused
annotation from the callback functions.
Signed-off-by: Diederik de Haas <diederik@cknow-tech.com>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
index f90e01301943..e619a949dbc9 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
@@ -305,7 +305,7 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
* Power
*/
-static int __maybe_unused rkisp1_runtime_suspend(struct device *dev)
+static int rkisp1_runtime_suspend(struct device *dev)
{
struct rkisp1_device *rkisp1 = dev_get_drvdata(dev);
@@ -331,7 +331,7 @@ static int __maybe_unused rkisp1_runtime_suspend(struct device *dev)
return pinctrl_pm_select_sleep_state(dev);
}
-static int __maybe_unused rkisp1_runtime_resume(struct device *dev)
+static int rkisp1_runtime_resume(struct device *dev)
{
struct rkisp1_device *rkisp1 = dev_get_drvdata(dev);
int ret;
@@ -351,9 +351,8 @@ static int __maybe_unused rkisp1_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops rkisp1_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
- SET_RUNTIME_PM_OPS(rkisp1_runtime_suspend, rkisp1_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+ RUNTIME_PM_OPS(rkisp1_runtime_suspend, rkisp1_runtime_resume, NULL)
};
/* ----------------------------------------------------------------------------
@@ -815,7 +814,7 @@ static struct platform_driver rkisp1_drv = {
.driver = {
.name = RKISP1_DRIVER_NAME,
.of_match_table = of_match_ptr(rkisp1_of_match),
- .pm = &rkisp1_pm_ops,
+ .pm = pm_ptr(&rkisp1_pm_ops),
},
.probe = rkisp1_probe,
.remove = rkisp1_remove,
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 3/3] media: rkisp1: Switch to modern PM_OPS
2026-10-01 17:34 ` [PATCH 3/3] media: rkisp1: " Diederik de Haas
@ 2026-10-02 1:46 ` Laurent Pinchart
0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2026-10-02 1:46 UTC (permalink / raw)
To: Diederik de Haas
Cc: Dafna Hirschfeld, Mauro Carvalho Chehab, Heiko Stuebner,
Detlev Casanova, Ezequiel Garcia, Jacob Chen, linux-media,
linux-rockchip, linux-arm-kernel, linux-kernel
On Thu, Oct 01, 2026 at 07:34:53PM +0200, Diederik de Haas wrote:
> A new set of modern PM_OPS macros got defined in commit
> 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones")
>
> Switch to those new macros so that the PM callbacks are always seen by the
> compiler, but discarded if not used. This lets us drop the __maybe_unused
> annotation from the callback functions.
>
> Signed-off-by: Diederik de Haas <diederik@cknow-tech.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
As the three patches in this series are independent from each other,
I've taken this in my tree.
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> index f90e01301943..e619a949dbc9 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> @@ -305,7 +305,7 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
> * Power
> */
>
> -static int __maybe_unused rkisp1_runtime_suspend(struct device *dev)
> +static int rkisp1_runtime_suspend(struct device *dev)
> {
> struct rkisp1_device *rkisp1 = dev_get_drvdata(dev);
>
> @@ -331,7 +331,7 @@ static int __maybe_unused rkisp1_runtime_suspend(struct device *dev)
> return pinctrl_pm_select_sleep_state(dev);
> }
>
> -static int __maybe_unused rkisp1_runtime_resume(struct device *dev)
> +static int rkisp1_runtime_resume(struct device *dev)
> {
> struct rkisp1_device *rkisp1 = dev_get_drvdata(dev);
> int ret;
> @@ -351,9 +351,8 @@ static int __maybe_unused rkisp1_runtime_resume(struct device *dev)
> }
>
> static const struct dev_pm_ops rkisp1_pm_ops = {
> - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
> - pm_runtime_force_resume)
> - SET_RUNTIME_PM_OPS(rkisp1_runtime_suspend, rkisp1_runtime_resume, NULL)
> + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
> + RUNTIME_PM_OPS(rkisp1_runtime_suspend, rkisp1_runtime_resume, NULL)
> };
>
> /* ----------------------------------------------------------------------------
> @@ -815,7 +814,7 @@ static struct platform_driver rkisp1_drv = {
> .driver = {
> .name = RKISP1_DRIVER_NAME,
> .of_match_table = of_match_ptr(rkisp1_of_match),
> - .pm = &rkisp1_pm_ops,
> + .pm = pm_ptr(&rkisp1_pm_ops),
> },
> .probe = rkisp1_probe,
> .remove = rkisp1_remove,
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 5+ messages in thread