Commit 244b6e92 authored by Marc Dietrich's avatar Marc Dietrich Committed by Greg Kroah-Hartman
Browse files

staging: nvec: add ability to ignore EC responses in sync writes



In case we just want to submit a message to the EC but are not
interested in its response, we can free the response buffer early.

Signed-off-by: default avatarMarc Dietrich <marvin24@gmx.de>
Link: https://lore.kernel.org/r/20240406123123.37148-2-marvin24@gmx.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 18f44de6
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -300,7 +300,9 @@ int nvec_write_sync(struct nvec_chip *nvec,
{
	mutex_lock(&nvec->sync_write_mutex);

	if (msg != NULL)
		*msg = NULL;

	nvec->sync_write_pending = (data[1] << 8) + data[0];

	if (nvec_write_async(nvec, data, size) < 0) {
@@ -320,7 +322,10 @@ int nvec_write_sync(struct nvec_chip *nvec,

	dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");

	if (msg != NULL)
		*msg = nvec->last_sync_msg;
	else
		nvec_msg_free(nvec, nvec->last_sync_msg);

	mutex_unlock(&nvec->sync_write_mutex);