[PATCH 2/3] media: rockchip: rga: Switch to modern PM_OPS

Diederik de Haas diederik at cknow-tech.com
Thu Oct 1 10:34:52 PDT 2026


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 at 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




More information about the Linux-rockchip mailing list