mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
media: i2c: imx334: Enable runtime PM before sub-device registration
Runtime PM is fully initialized before calling v4l2_async_register_subdev_sensor(). Moving the runtime PM initialization earlier prevents potential access to an uninitialized or powered-down device. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
b493cd3c03
commit
01dfdf6a80
|
|
@ -1287,6 +1287,9 @@ static int imx334_probe(struct i2c_client *client)
|
|||
goto error_handler_free;
|
||||
}
|
||||
|
||||
pm_runtime_set_active(imx334->dev);
|
||||
pm_runtime_enable(imx334->dev);
|
||||
|
||||
ret = v4l2_async_register_subdev_sensor(&imx334->sd);
|
||||
if (ret < 0) {
|
||||
dev_err(imx334->dev,
|
||||
|
|
@ -1294,13 +1297,13 @@ static int imx334_probe(struct i2c_client *client)
|
|||
goto error_media_entity;
|
||||
}
|
||||
|
||||
pm_runtime_set_active(imx334->dev);
|
||||
pm_runtime_enable(imx334->dev);
|
||||
pm_runtime_idle(imx334->dev);
|
||||
|
||||
return 0;
|
||||
|
||||
error_media_entity:
|
||||
pm_runtime_disable(imx334->dev);
|
||||
pm_runtime_set_suspended(imx334->dev);
|
||||
media_entity_cleanup(&imx334->sd.entity);
|
||||
error_handler_free:
|
||||
v4l2_ctrl_handler_free(imx334->sd.ctrl_handler);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user