Re: [PATCH 1/3] media: rkvdec: Switch to modern PM_OPS
From: Nicolas Dufresne
Date: Fri Oct 02 2026 - 15:55:23 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 check for
> CONFIG_PM.
>
> Signed-off-by: Diederik de Haas <diederik@xxxxxxxxxxxxxx>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
> ---
> 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);
Attachment:
signature.asc
Description: This is a digitally signed message part