Skip to content

Commit cedfde9

Browse files
emfendgregkh
authored andcommitted
media: i2c: ov08d10: fix runtime PM handling in probe
commit 35c7046 upstream. Set the device's runtime PM status and enable runtime PM before registering the async sub-device. This is needed to avoid the case where the device is runtime PM resumed while runtime PM has not been enabled yet. Remove the related, non-driver-specific comment while at it. Fixes: 7be91e0 ("media: i2c: Add ov08d10 camera sensor driver") Cc: stable@vger.kernel.org Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Matthias Fend <matthias.fend@emfend.at> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d9e678e commit cedfde9

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

drivers/media/i2c/ov08d10.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,24 +1430,23 @@ static int ov08d10_probe(struct i2c_client *client)
14301430
goto probe_error_v4l2_ctrl_handler_free;
14311431
}
14321432

1433+
pm_runtime_set_active(ov08d10->dev);
1434+
pm_runtime_enable(ov08d10->dev);
1435+
14331436
ret = v4l2_async_register_subdev_sensor(&ov08d10->sd);
14341437
if (ret < 0) {
14351438
dev_err(ov08d10->dev, "failed to register V4L2 subdev: %d",
14361439
ret);
14371440
goto probe_error_media_entity_cleanup;
14381441
}
14391442

1440-
/*
1441-
* Device is already turned on by i2c-core with ACPI domain PM.
1442-
* Enable runtime PM and turn off the device.
1443-
*/
1444-
pm_runtime_set_active(ov08d10->dev);
1445-
pm_runtime_enable(ov08d10->dev);
14461443
pm_runtime_idle(ov08d10->dev);
14471444

14481445
return 0;
14491446

14501447
probe_error_media_entity_cleanup:
1448+
pm_runtime_disable(ov08d10->dev);
1449+
pm_runtime_set_suspended(ov08d10->dev);
14511450
media_entity_cleanup(&ov08d10->sd.entity);
14521451

14531452
probe_error_v4l2_ctrl_handler_free:

0 commit comments

Comments
 (0)