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>
v4l2_device_unregister(&jpu->v4l2_dev);
}
-#ifdef CONFIG_PM_SLEEP
static int jpu_suspend(struct device *dev)
{
struct jpu *jpu = dev_get_drvdata(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,
.driver = {
.of_match_table = jpu_dt_ids,
.name = DRV_NAME,
- .pm = &jpu_pm_ops,
+ .pm = pm_sleep_ptr(&jpu_pm_ops),
},
};