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

Commit d851cf4b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents aa78dee7 551c6837
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1296,6 +1296,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) {
@@ -1758,12 +1765,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);