On Thu Sep 4 17:33:34 2025 +0200, Geert Uytterhoeven wrote:
> 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 <[email protected]>
> Reviewed-by: Nikita Yushchenko <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/renesas/rcar_jpu.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

---

diff --git a/drivers/media/platform/renesas/rcar_jpu.c 
b/drivers/media/platform/renesas/rcar_jpu.c
index 3d714fec4fad..a6d26b446494 100644
--- a/drivers/media/platform/renesas/rcar_jpu.c
+++ b/drivers/media/platform/renesas/rcar_jpu.c
@@ -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),
        },
 };
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to