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

Commit 72000c3a 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 9a711d9c 92a08c11
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1242,6 +1242,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) {
@@ -1699,12 +1706,6 @@ static ssize_t spcom_device_write(struct file *filp,
			return -EINVAL;
		}
		pr_debug("control device - no channel context\n");
	} else {
		/* Check if remote side connect */
		if (!spcom_is_channel_connected(ch)) {
			pr_err("ch [%s] remote side not connect\n", ch->name);
			return -ENOTCONN;
		}
	}
	buf_size = size; /* explicit casting size_t to int */
	buf = kzalloc(size, GFP_KERNEL);