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

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

Merge "msm: camera: core: Add error log to identify node" into dev/msm-4.9-camx

parents 3bef0eca 2abfe548
Loading
Loading
Loading
Loading
+25 −8
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ static int __cam_node_handle_acquire_dev(struct cam_node *node,

	rc = cam_context_handle_acquire_dev(ctx, acquire);
	if (rc) {
		CAM_ERR(CAM_CORE, "Acquire device failed");
		CAM_ERR(CAM_CORE, "Acquire device failed for node %s",
			node->name);
		goto free_ctx;
	}

@@ -82,6 +83,7 @@ static int __cam_node_handle_start_dev(struct cam_node *node,
	struct cam_start_stop_dev_cmd *start)
{
	struct cam_context *ctx = NULL;
	int rc;

	if (!start)
		return -EINVAL;
@@ -103,13 +105,18 @@ static int __cam_node_handle_start_dev(struct cam_node *node,
		return -EINVAL;
	}

	return cam_context_handle_start_dev(ctx, start);
	rc = cam_context_handle_start_dev(ctx, start);
	if (rc)
		CAM_ERR(CAM_CORE, "Start failure for node %s", node->name);

	return rc;
}

static int __cam_node_handle_stop_dev(struct cam_node *node,
	struct cam_start_stop_dev_cmd *stop)
{
	struct cam_context *ctx = NULL;
	int rc;

	if (!stop)
		return -EINVAL;
@@ -131,13 +138,18 @@ static int __cam_node_handle_stop_dev(struct cam_node *node,
		return -EINVAL;
	}

	return cam_context_handle_stop_dev(ctx, stop);
	rc = cam_context_handle_stop_dev(ctx, stop);
	if (rc)
		CAM_ERR(CAM_CORE, "Stop failure for node %s", node->name);

	return rc;
}

static int __cam_node_handle_config_dev(struct cam_node *node,
	struct cam_config_dev_cmd *config)
{
	struct cam_context *ctx = NULL;
	int rc;

	if (!config)
		return -EINVAL;
@@ -159,7 +171,11 @@ static int __cam_node_handle_config_dev(struct cam_node *node,
		return -EINVAL;
	}

	return cam_context_handle_config_dev(ctx, config);
	rc = cam_context_handle_config_dev(ctx, config);
	if (rc)
		CAM_ERR(CAM_CORE, "Config failure for node %s", node->name);

	return rc;
}

static int __cam_node_handle_release_dev(struct cam_node *node,
@@ -183,18 +199,19 @@ static int __cam_node_handle_release_dev(struct cam_node *node,

	ctx = (struct cam_context *)cam_get_device_priv(release->dev_handle);
	if (!ctx) {
		CAM_ERR(CAM_CORE, "Can not get context for handle %d",
			release->dev_handle);
		CAM_ERR(CAM_CORE, "Can not get context for handle %d node %s",
			release->dev_handle, node->name);
		return -EINVAL;
	}

	rc = cam_context_handle_release_dev(ctx, release);
	if (rc)
		CAM_ERR(CAM_CORE, "context release failed");
		CAM_ERR(CAM_CORE, "context release failed node %s", node->name);

	rc = cam_destroy_device_hdl(release->dev_handle);
	if (rc)
		CAM_ERR(CAM_CORE, "destroy device handle is failed");
		CAM_ERR(CAM_CORE, "destroy device handle is failed node %s",
			node->name);

	mutex_lock(&node->list_mutex);
	list_add_tail(&ctx->list, &node->free_ctx_list);