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

Commit 34dc2654 authored by Karthik Anantha Ram's avatar Karthik Anantha Ram
Browse files

msm: camera: isp: Fix the reset value of link_hdl



link_hdl is int32 variable. 0 is a valid value. So
in reset assign link_hdl to -1 instead of 0. Change
condition to check for valid values to >=0.

Change-Id: I2456dc77f68a4f289574ef1ebd0d2628f7c5a1d4
Signed-off-by: default avatarKarthik Anantha Ram <kartanan@codeaurora.org>
parent ee40106f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -355,6 +355,8 @@ int cam_context_init(struct cam_context *ctx,

	memset(ctx, 0, sizeof(*ctx));
	ctx->dev_hdl = -1;
	ctx->link_hdl = -1;
	ctx->session_hdl = -1;
	INIT_LIST_HEAD(&ctx->list);
	mutex_init(&ctx->ctx_mutex);
	spin_lock_init(&ctx->lock);
+3 −3
Original line number Diff line number Diff line
@@ -1781,7 +1781,7 @@ static int __cam_isp_ctx_config_dev_in_acquired(struct cam_context *ctx,

	rc = __cam_isp_ctx_config_dev_in_top_state(ctx, cmd);

	if (!rc && ctx->link_hdl) {
	if (!rc && (ctx->link_hdl >= 0)) {
		ctx->state = CAM_CTX_READY;
		trace_cam_context_state("ISP", ctx);
	}
@@ -1819,7 +1819,7 @@ static int __cam_isp_ctx_unlink_in_acquired(struct cam_context *ctx,
{
	int rc = 0;

	ctx->link_hdl = 0;
	ctx->link_hdl = -1;
	ctx->ctx_crm_intf = NULL;

	return rc;
@@ -1905,7 +1905,7 @@ static int __cam_isp_ctx_unlink_in_ready(struct cam_context *ctx,
{
	int rc = 0;

	ctx->link_hdl = 0;
	ctx->link_hdl = -1;
	ctx->ctx_crm_intf = NULL;
	ctx->state = CAM_CTX_ACQUIRED;
	trace_cam_context_state("ISP", ctx);