mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: hansg@kernel.org
Cc: ilpo.jarvinen@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] platform/wmi: Convert drivers to use wmidev_invoke_procedure()
Date: Mon,  6 Apr 2026 22:32:33 +0200	[thread overview]
Message-ID: <20260406203237.2970-3-W_Armin@gmx.de> (raw)
In-Reply-To: <20260406203237.2970-1-W_Armin@gmx.de>

Convert users of wmidev_invoke_method() to wmidev_invoke_procedure()
where applicable to prepare for future changes.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/platform/x86/bitland-mifs-wmi.c      | 17 +++++++++--------
 drivers/platform/x86/intel/wmi/thunderbolt.c |  2 +-
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index 54380708b7b0..cd3cdd087511 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -167,23 +167,24 @@ static int bitland_mifs_wmi_call(struct bitland_mifs_wmi_data *data,
 				 struct bitland_mifs_output *output)
 {
 	struct wmi_buffer in_buf = { .length = sizeof(*input), .data = (void *)input };
+	void *out_data __free(kfree) = NULL;
 	struct wmi_buffer out_buf = { 0 };
 	int ret;
 
 	guard(mutex)(&data->lock);
 
-	ret = wmidev_invoke_method(data->wdev, 0, 1, &in_buf, output ? &out_buf : NULL);
+	if (!output)
+		return wmidev_invoke_procedure(data->wdev, 0, 1, &in_buf);
+
+	ret = wmidev_invoke_method(data->wdev, 0, 1, &in_buf, &out_buf);
 	if (ret)
 		return ret;
 
-	if (output) {
-		void *out_data __free(kfree) = out_buf.data;
-
-		if (out_buf.length < sizeof(*output))
-			return -EIO;
+	out_data = out_buf.data;
+	if (out_buf.length < sizeof(*output))
+		return -EIO;
 
-		memcpy(output, out_data, sizeof(*output));
-	}
+	memcpy(output, out_data, sizeof(*output));
 
 	return 0;
 }
diff --git a/drivers/platform/x86/intel/wmi/thunderbolt.c b/drivers/platform/x86/intel/wmi/thunderbolt.c
index 47017f2d7597..9b1920d61674 100644
--- a/drivers/platform/x86/intel/wmi/thunderbolt.c
+++ b/drivers/platform/x86/intel/wmi/thunderbolt.c
@@ -34,7 +34,7 @@ static ssize_t force_power_store(struct device *dev,
 	if (mode > 1)
 		return -EINVAL;
 
-	ret = wmidev_invoke_method(to_wmi_device(dev), 0, 1, &buffer, NULL);
+	ret = wmidev_invoke_procedure(to_wmi_device(dev), 0, 1, &buffer);
 	if (ret < 0)
 		return ret;
 
-- 
2.39.5


  parent reply	other threads:[~2026-04-06 21:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06 20:32 [PATCH 0/6] platform/wmi: Use WMI driver core for size checks Armin Wolf
2026-04-06 20:32 ` [PATCH 1/6] platform/wmi: Add wmidev_invoke_procedure() Armin Wolf
2026-04-06 20:32 ` Armin Wolf [this message]
2026-04-06 20:32 ` [PATCH 3/6] platform/wmi: Prepare to reject undersized unmarshalling results Armin Wolf
2026-04-06 20:32 ` [PATCH 4/6] platform/wmi: Extend wmidev_invoke_method() to reject undersized data Armin Wolf
2026-04-06 20:32 ` [PATCH 5/6] platform/wmi: Extend wmidev_query_block() " Armin Wolf
2026-04-06 20:32 ` [PATCH 6/6] platform/wmi: Replace .no_notify_data with .min_event_size Armin Wolf
2026-04-10 16:28 ` [PATCH 0/6] platform/wmi: Use WMI driver core for size checks Ilpo Järvinen
2026-04-13  6:20   ` Armin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260406203237.2970-3-W_Armin@gmx.de \
    --to=w_armin@gmx.de \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®