public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: alienware-wmi-base: Transition to new WMI API
@ 2026-03-30 15:50 Kurt Borja
  2026-03-30 23:26 ` Armin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Kurt Borja @ 2026-03-30 15:50 UTC (permalink / raw)
  To: Ilpo Järvinen, Armin Wolf, Hans de Goede
  Cc: platform-driver-x86, Dell.Client.Kernel, linux-kernel, Kurt Borja

Transition to the new wmi_buffer based WMI API.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
 drivers/platform/x86/dell/alienware-wmi-base.c | 29 ++++++++++++++------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/dell/alienware-wmi-base.c b/drivers/platform/x86/dell/alienware-wmi-base.c
index 64562b92314f..ef2b4893b7b5 100644
--- a/drivers/platform/x86/dell/alienware-wmi-base.c
+++ b/drivers/platform/x86/dell/alienware-wmi-base.c
@@ -9,7 +9,6 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/acpi.h>
-#include <linux/cleanup.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/dmi.h>
@@ -150,23 +149,27 @@ u8 alienware_interface;
 int alienware_wmi_command(struct wmi_device *wdev, u32 method_id,
 			  void *in_args, size_t in_size, u32 *out_data)
 {
-	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
-	struct acpi_buffer in = {in_size, in_args};
-	acpi_status ret;
+	struct wmi_buffer out, in = {
+		.data = in_args,
+		.length = in_size,
+	};
+	int ret;
 
-	ret = wmidev_evaluate_method(wdev, 0, method_id, &in, out_data ? &out : NULL);
-	if (ACPI_FAILURE(ret))
-		return -EIO;
+	ret = wmidev_invoke_method(wdev, 0, method_id, &in, out_data ? &out : NULL);
+	if (ret)
+		return ret;
 
-	union acpi_object *obj __free(kfree) = out.pointer;
+	if (!out_data)
+		return 0;
 
-	if (out_data) {
-		if (obj && obj->type == ACPI_TYPE_INTEGER)
-			*out_data = (u32)obj->integer.value;
-		else
-			return -ENOMSG;
+	if (out.length < sizeof(*out_data)) {
+		kfree(out.data);
+		return -ENOMSG;
 	}
 
+	*out_data = *(u32 *)out.data;
+	kfree(out.data);
+
 	return 0;
 }
 

---
base-commit: fab7c51693e95aa874d6d9db22bfae7bd0b23c66
change-id: 20260123-aw-new-api-1c18f1011f35

-- 
Thanks, 
 ~ Kurt


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-31  5:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 15:50 [PATCH] platform/x86: alienware-wmi-base: Transition to new WMI API Kurt Borja
2026-03-30 23:26 ` Armin Wolf
2026-03-31  5:11   ` Kurt Borja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox