media: i2c: imx290: Initialize runtime PM before subdev
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 16 Jan 2023 14:44:51 +0000 (15:44 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 3 Feb 2023 14:05:02 +0000 (15:05 +0100)
commit02852c01f65402e2fe4a8a5fe5a0b641f245b529
treec338cd9357b2502e3dbea1fc9eac05b8fc318c42
parenta8c3e0c1bf1e97b5ee094951ed0f1e57e3b378c7
media: i2c: imx290: Initialize runtime PM before subdev

Initializing the subdev before runtime PM means that no subdev
initialization can interact with the runtime PM framework. This can be
problematic when modifying controls, as the .s_ctrl() handler commonly
calls pm_runtime_get_if_in_use(). These code paths are not trivial,
making the driver fragile and possibly causing subtle bugs.

To make the subdev initialization more robust, initialize runtime PM
first.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/imx290.c