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

Commit 37df6d88 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Print v4l2 event details on error"

parents a4e29f3e 4e192f9d
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -631,6 +631,18 @@ static unsigned int msm_poll(struct file *f,
	return rc;
}

static void msm_print_event_error(struct v4l2_event *event)
{
	struct msm_v4l2_event_data *event_data =
		(struct msm_v4l2_event_data *)&event->u.data[0];

	pr_err("Evt_type=%x Evt_id=%d Evt_cmd=%x\n", event->type,
		event->id, event_data->command);
	pr_err("Evt_session_id=%d Evt_stream_id=%d Evt_arg=%d\n",
		event_data->session_id, event_data->stream_id,
		event_data->arg_value);
}

/* something seriously wrong if msm_close is triggered
 *   !!! user space imaging server is shutdown !!!
 */
@@ -691,10 +703,12 @@ int msm_post_event(struct v4l2_event *event, int timeout)
	if (list_empty_careful(&cmd_ack->command_q.list)) {
		if (!rc) {
			pr_err("%s: Timed out\n", __func__);
			msm_print_event_error(event);
			rc = -ETIMEDOUT;
		}
		if (rc < 0) {
			pr_err("%s: rc = %d\n", __func__, rc);
			msm_print_event_error(event);
			mutex_unlock(&session->lock);
			return rc;
		}