Commit cc989acb authored by Martin Kepplinger's avatar Martin Kepplinger
Browse files

hi846: fix powering off in remove()

properly power off, but only if needed.
parent 629e1580
......@@ -1564,9 +1564,13 @@ static int hi846_remove(struct i2c_client *client)
v4l2_async_unregister_subdev(sd);
media_entity_cleanup(&sd->entity);
v4l2_ctrl_handler_free(sd->ctrl_handler);
pm_runtime_disable(&client->dev);
if (!pm_runtime_status_suspended(&client->dev))
hi846_suspend(&client->dev);
pm_runtime_set_suspended(&client->dev);
mutex_destroy(&hi846->mutex);
hi846_regulator_disable(hi846);
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment