[RFC,03/12] media: i2c: ov5645: Enable runtime PM after v4l2_async_register_subdev()
Checks
Context |
Check |
Description |
media-ci/HTML_report |
success
|
Link
|
media-ci/report |
success
|
Link
|
media-ci/bisect |
fail
|
Link
|
media-ci/doc |
success
|
Link
|
media-ci/build |
fail
|
Link
|
media-ci/static-upstream |
fail
|
Link
|
media-ci/abi |
success
|
Link
|
media-ci/media-patchstyle |
success
|
Link
|
media-ci/checkpatch |
success
|
Link
|
Commit Message
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
To simplify the probe error path, enable runtime PM after the
v4l2_async_register_subdev() call.
This change ensures that runtime PM is only enabled once the subdevice
registration is successful, avoiding unnecessary cleanup in the error
path.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
drivers/media/i2c/ov5645.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
@@ -1239,18 +1239,17 @@ static int ov5645_probe(struct i2c_client *client)
goto power_down;
}
- pm_runtime_set_active(dev);
- pm_runtime_get_noresume(dev);
- pm_runtime_enable(dev);
-
ov5645_init_state(&ov5645->sd, NULL);
ret = v4l2_async_register_subdev(&ov5645->sd);
if (ret < 0) {
dev_err(dev, "could not register v4l2 device\n");
- goto err_pm_runtime;
+ goto power_down;
}
+ pm_runtime_set_active(dev);
+ pm_runtime_get_noresume(dev);
+ pm_runtime_enable(dev);
pm_runtime_set_autosuspend_delay(dev, 1000);
pm_runtime_use_autosuspend(dev);
pm_runtime_mark_last_busy(dev);
@@ -1258,9 +1257,6 @@ static int ov5645_probe(struct i2c_client *client)
return 0;
-err_pm_runtime:
- pm_runtime_disable(dev);
- pm_runtime_put_noidle(dev);
power_down:
ov5645_set_power_off(dev);
free_entity: