public inbox for platform-driver-x86@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kurt Borja" <kuurtb@gmail.com>
To: "Armin Wolf" <W_Armin@gmx.de>, "Kurt Borja" <kuurtb@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Hans de Goede" <hansg@kernel.org>
Cc: <platform-driver-x86@vger.kernel.org>,
	<Dell.Client.Kernel@dell.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/x86: alienware-wmi-base: Transition to new WMI API
Date: Tue, 31 Mar 2026 00:11:33 -0500	[thread overview]
Message-ID: <DHGPJY9K6HMT.14WH9C5KDC7B5@gmail.com> (raw)
In-Reply-To: <ea8c7adc-7caf-4305-b2c7-dca38524629c@gmx.de>

On Mon Mar 30, 2026 at 6:26 PM -05, Armin Wolf wrote:
> Am 30.03.26 um 17:50 schrieb 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;
>
> Please cast the output data to a __le32 * and use le32_to_cpu() to take the endianess into account.
> The rest looks fine to me.

Hi Armin,

Will do -- Thanks!

>
> Thanks,
> Armin Wolf

-- 
Thanks,
 ~ Kurt

      reply	other threads:[~2026-03-31  5:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=DHGPJY9K6HMT.14WH9C5KDC7B5@gmail.com \
    --to=kuurtb@gmail.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=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