For example, if we run stf_isp_ctrl & v4l2test at the same time,
s_stream for sensor will be called twice,
so that rpm should be got twice too.
Signed-off-by: Kevin.xie <kevin.xie@starfivetech.com>
int ret = 0;
mutex_lock(&imx219->mutex);
- if (imx219->streaming && enable)
- goto unlock;
if (enable) {
ret = pm_runtime_get_sync(&client->dev);
if (ret < 0) {
pm_runtime_put_noidle(&client->dev);
+ mutex_unlock(&imx219->mutex);
return ret;
}
+ if (imx219->streaming)
+ goto unlock;
+
/*
* Apply default & customized values
* and then start streaming.