]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: rcar_jpu: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 4 Sep 2025 15:33:34 +0000 (17:33 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 3 Nov 2025 14:58:41 +0000 (15:58 +0100)
Convert the Renesas JPEG Processing Unit driver from an open-coded
dev_pm_ops structure to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().
This lets us drop the check for CONFIG_PM_SLEEP, and reduces kernel size
in case CONFIG_PM or CONFIG_PM_SLEEP is disabled, while increasing build
coverage.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/renesas/rcar_jpu.c

index 3d714fec4fad6f913a38dea4db45e426567c146e..a6d26b446494ae84723a917c192778b91be32475 100644 (file)
@@ -1693,7 +1693,6 @@ static void jpu_remove(struct platform_device *pdev)
        v4l2_device_unregister(&jpu->v4l2_dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int jpu_suspend(struct device *dev)
 {
        struct jpu *jpu = dev_get_drvdata(dev);
@@ -1717,11 +1716,8 @@ static int jpu_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
-static const struct dev_pm_ops jpu_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(jpu_suspend, jpu_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(jpu_pm_ops, jpu_suspend, jpu_resume);
 
 static struct platform_driver jpu_driver = {
        .probe = jpu_probe,
@@ -1729,7 +1725,7 @@ static struct platform_driver jpu_driver = {
        .driver = {
                .of_match_table = jpu_dt_ids,
                .name = DRV_NAME,
-               .pm = &jpu_pm_ops,
+               .pm = pm_sleep_ptr(&jpu_pm_ops),
        },
 };