Unverified Commit 2fa74713 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

ASoC: SOF: ipc4-control: If there is no data do not send bytes update



When the bytes control have no data (payload) then there is no need to send
an IPC message as there is nothing to send.

Fixes: a062c889 ("ASoC: SOF: ipc4-control: Add support for bytes control get and put")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarSeppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20251217143945.2667-2-peter.ujfalusi@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8f0b4cce
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -412,9 +412,17 @@ static int sof_ipc4_set_get_bytes_data(struct snd_sof_dev *sdev,
	int ret = 0;

	/* Send the new data to the firmware only if it is powered up */
	if (set && !pm_runtime_active(sdev->dev))
	if (set) {
		if (!pm_runtime_active(sdev->dev))
			return 0;

		if (!data->size) {
			dev_dbg(sdev->dev, "%s: No data to be sent.\n",
				scontrol->name);
			return 0;
		}
	}

	msg->extension = SOF_IPC4_MOD_EXT_MSG_PARAM_ID(data->type);

	msg->data_ptr = data->data;