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

Commit 551c6837 authored by Liron Daniel's avatar Liron Daniel Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: spcom: allow commands for not connected channel



Test channel connection state only for commands that need to communicate
to SPU. All other commands do not need channel to be connected.

Change-Id: I372ab6cb6d9f897143c3591c93c4e3821d657da3
Signed-off-by: default avatarLiron Daniel <lirond@codeaurora.org>
parent ad8b0e3f
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1298,6 +1298,13 @@ static int spcom_handle_write(struct spcom_channel *ch,
		return -EINVAL;
	}

	if (cmd_id == SPCOM_CMD_SEND || cmd_id == SPCOM_CMD_SEND_MODIFIED) {
		if (!spcom_is_channel_connected(ch)) {
			pr_err("ch [%s] remote side not connected\n", ch->name);
			return -ENOTCONN;
		}
	}

	switch (cmd_id) {
	case SPCOM_CMD_SEND:
		if (ch->is_sharable) {
@@ -1760,12 +1767,6 @@ static ssize_t spcom_device_write(struct file *filp,
			return -EINVAL;
		}
		spcom_pr_dbg("control device - no channel context\n");
	} else {
		/* Check if remote side connect */
		if (!spcom_is_channel_connected(ch)) {
			spcom_pr_err("ch [%s] not connected\n", ch->name);
			return -ENOTCONN;
		}
	}
	buf_size = size; /* explicit casting size_t to int */
	buf = kzalloc(size, GFP_KERNEL);