Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c7831e8 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Change the mutex lock acquire in flush" into dev/msm-4.14-camx

parents 8127efdc 77d6979e
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -902,21 +902,19 @@ int32_t cam_actuator_flush_request(struct cam_req_mgr_flush_request *flush_req)
	if (!flush_req)
		return -EINVAL;

	mutex_lock(&(a_ctrl->actuator_mutex));
	a_ctrl = (struct cam_actuator_ctrl_t *)
		cam_get_device_priv(flush_req->dev_hdl);
	if (!a_ctrl) {
		CAM_ERR(CAM_ACTUATOR, "Device data is NULL");
		rc = -EINVAL;
		goto end;
		return -EINVAL;
	}

	if (a_ctrl->i2c_data.per_frame == NULL) {
		CAM_ERR(CAM_ACTUATOR, "i2c frame data is NULL");
		rc = -EINVAL;
		goto end;
		return -EINVAL;
	}

	mutex_lock(&(a_ctrl->actuator_mutex));
	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		a_ctrl->last_flush_req = flush_req->req_id;
		CAM_DBG(CAM_ACTUATOR, "last reqest to flush is %lld",
@@ -950,7 +948,6 @@ int32_t cam_actuator_flush_request(struct cam_req_mgr_flush_request *flush_req)
		CAM_DBG(CAM_ACTUATOR,
			"Flush request id:%lld not found in the pending list",
			flush_req->req_id);
end:
	mutex_unlock(&(a_ctrl->actuator_mutex));
	return rc;
}
+2 −3
Original line number Diff line number Diff line
@@ -387,14 +387,13 @@ int cam_flash_flush_request(struct cam_req_mgr_flush_request *flush)
	int rc = 0;
	struct cam_flash_ctrl *fctrl = NULL;

	mutex_lock(&fctrl->flash_mutex);
	fctrl = (struct cam_flash_ctrl *) cam_get_device_priv(flush->dev_hdl);
	if (!fctrl) {
		CAM_ERR(CAM_FLASH, "Device data is NULL");
		rc = -EINVAL;
		goto end;
		return -EINVAL;
	}

	mutex_lock(&fctrl->flash_mutex);
	if (flush->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		fctrl->last_flush_req = flush->req_id;
		CAM_DBG(CAM_FLASH, "last reqest to flush is %lld",
+3 −6
Original line number Diff line number Diff line
@@ -1198,21 +1198,19 @@ int32_t cam_sensor_flush_request(struct cam_req_mgr_flush_request *flush_req)
	if (!flush_req)
		return -EINVAL;

	mutex_lock(&(s_ctrl->cam_sensor_mutex));
	s_ctrl = (struct cam_sensor_ctrl_t *)
		cam_get_device_priv(flush_req->dev_hdl);
	if (!s_ctrl) {
		CAM_ERR(CAM_SENSOR, "Device data is NULL");
		rc = -EINVAL;
		goto end;
		return -EINVAL;
	}

	if (s_ctrl->i2c_data.per_frame == NULL) {
		CAM_ERR(CAM_SENSOR, "i2c frame data is NULL");
		rc = -EINVAL;
		goto end;
		return -EINVAL;
	}

	mutex_lock(&(s_ctrl->cam_sensor_mutex));
	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		s_ctrl->last_flush_req = flush_req->req_id;
		CAM_DBG(CAM_SENSOR, "last reqest to flush is %lld",
@@ -1246,7 +1244,6 @@ int32_t cam_sensor_flush_request(struct cam_req_mgr_flush_request *flush_req)
		CAM_DBG(CAM_SENSOR,
			"Flush request id:%lld not found in the pending list",
			flush_req->req_id);
end:
	mutex_unlock(&(s_ctrl->cam_sensor_mutex));
	return rc;
}