On Wed Jul 9 21:16:10 2025 +0200, Geert Uytterhoeven wrote:
> Convert the Renesas Capture Engine Unit driver from SET_RUNTIME_PM_OPS()
> to RUNTIME_PM_OPS() and pm_ptr(). This lets us drop the __maybe_unused
> annotations from its runtime suspend and resume callbacks, and reduces
> kernel size in case CONFIG_PM is disabled.
>
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> Reviewed-by: Fabrizio Castro <[email protected]>
> Reviewed-by: Laurent Pinchart <[email protected]>
> Signed-off-by: Laurent Pinchart <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>
Patch committed.
Thanks,
Hans Verkuil
drivers/media/platform/renesas/renesas-ceu.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/drivers/media/platform/renesas/renesas-ceu.c
b/drivers/media/platform/renesas/renesas-ceu.c
index 8cceafe491b1..deed49d0fb10 100644
--- a/drivers/media/platform/renesas/renesas-ceu.c
+++ b/drivers/media/platform/renesas/renesas-ceu.c
@@ -1048,7 +1048,7 @@ static int ceu_init_mbus_fmt(struct ceu_device *ceudev)
/*
* ceu_runtime_resume() - soft-reset the interface and turn sensor power on.
*/
-static int __maybe_unused ceu_runtime_resume(struct device *dev)
+static int ceu_runtime_resume(struct device *dev)
{
struct ceu_device *ceudev = dev_get_drvdata(dev);
struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1064,7 +1064,7 @@ static int __maybe_unused ceu_runtime_resume(struct
device *dev)
* ceu_runtime_suspend() - disable capture and interrupts and soft-reset.
* Turn sensor power off.
*/
-static int __maybe_unused ceu_runtime_suspend(struct device *dev)
+static int ceu_runtime_suspend(struct device *dev)
{
struct ceu_device *ceudev = dev_get_drvdata(dev);
struct v4l2_subdev *v4l2_sd = ceudev->sd->v4l2_sd;
@@ -1709,15 +1709,13 @@ static void ceu_remove(struct platform_device *pdev)
}
static const struct dev_pm_ops ceu_pm_ops = {
- SET_RUNTIME_PM_OPS(ceu_runtime_suspend,
- ceu_runtime_resume,
- NULL)
+ RUNTIME_PM_OPS(ceu_runtime_suspend, ceu_runtime_resume, NULL)
};
static struct platform_driver ceu_driver = {
.driver = {
.name = DRIVER_NAME,
- .pm = &ceu_pm_ops,
+ .pm = pm_ptr(&ceu_pm_ops),
.of_match_table = of_match_ptr(ceu_of_match),
},
.probe = ceu_probe,