diff --git a/drivers/media/i2c/ov05c10.c b/drivers/media/i2c/ov05c10.c index d6d7ced4beb6..692474cbe84b 100644 --- a/drivers/media/i2c/ov05c10.c +++ b/drivers/media/i2c/ov05c10.c @@ -910,6 +910,8 @@ static int ov05c10_probe(struct i2c_client *client) return 0; probe_error_rpm: + if (full_power) + pm_runtime_set_suspended(&client->dev); pm_runtime_disable(&client->dev); v4l2_subdev_cleanup(&ov05c10->sd); @@ -920,7 +922,8 @@ static int ov05c10_probe(struct i2c_client *client) v4l2_ctrl_handler_free(ov05c10->sd.ctrl_handler); probe_error_power_off: - ov05c10_power_off(&client->dev); + if (full_power) + ov05c10_power_off(&client->dev); return ret; } @@ -934,6 +937,7 @@ static void ov05c10_remove(struct i2c_client *client) v4l2_subdev_cleanup(sd); media_entity_cleanup(&ov05c10->sd.entity); v4l2_ctrl_handler_free(&ov05c10->ctrl_handler); + pm_runtime_dont_use_autosuspend(&client->dev); pm_runtime_disable(&client->dev); if (!pm_runtime_status_suspended(&client->dev)) {