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

From: Nicolas Dufresne

Date: Fri Oct 02 2026 - 15:56:34 EST


Le jeudi 01 octobre 2026 à 19:34 +0200, Diederik de Haas a écrit :
> 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@xxxxxxxxxxxxxx>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>

> ---
> 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,
> },
> };

Attachment: signature.asc
Description: This is a digitally signed message part