Commit 2549f534 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Hans Verkuil
Browse files

media: renesas: ceu: Convert to RUNTIME_PM_OPS()



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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarFabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil+cisco@kernel.org>
parent 2ca1d2a0
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -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,