mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
media: imx355: Avoid calling imx355_power_off twice in error path
If v4l2_async_register_subdev_sensor failed, then the sensor had
already been powered down by pm_runtime_idle, but the error path
then also explicitly called imx355_power_off as well. That left
an imbalance in the regulator and clock calls.
Call pm_runtime_idle only after v4l2_async_register_subdev_sensor
succeeds to avoid this.
Fixes: efa5fe19c0 ("media: imx355: Enable runtime PM before registering async sub-device")
Cc: stable@vger.kernel.org
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
This commit is contained in:
committed by
Sakari Ailus
parent
7a1e5239ae
commit
ee737bc3cc
@@ -1822,12 +1822,13 @@ static int imx355_probe(struct i2c_client *client)
|
||||
*/
|
||||
pm_runtime_set_active(imx355->dev);
|
||||
pm_runtime_enable(imx355->dev);
|
||||
pm_runtime_idle(imx355->dev);
|
||||
|
||||
ret = v4l2_async_register_subdev_sensor(&imx355->sd);
|
||||
if (ret < 0)
|
||||
goto error_media_entity_runtime_pm;
|
||||
|
||||
pm_runtime_idle(imx355->dev);
|
||||
|
||||
return 0;
|
||||
|
||||
error_media_entity_runtime_pm:
|
||||
|
||||
Reference in New Issue
Block a user