mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
platform/x86: alienware-wmi-base: Transition to new WMI API
Transition to the new wmi_buffer based WMI API. Signed-off-by: Kurt Borja <kuurtb@gmail.com> Reviewed-by: Armin Wolf <W_Armin@gmx.de> Link: https://patch.msgid.link/20260429-aw-new-api-v5-1-7702668d04c6@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
f5a8b9ee3c
commit
5809de26cc
|
|
@ -12,8 +12,13 @@
|
|||
#include <linux/cleanup.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#include "alienware-wmi.h"
|
||||
|
||||
MODULE_AUTHOR("Mario Limonciello <mario.limonciello@outlook.com>");
|
||||
|
|
@ -150,22 +155,22 @@ 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;
|
||||
if (!out_data)
|
||||
return wmidev_invoke_procedure(wdev, 0, method_id, &in);
|
||||
|
||||
union acpi_object *obj __free(kfree) = out.pointer;
|
||||
ret = wmidev_invoke_method(wdev, 0, method_id, &in, &out,
|
||||
sizeof(*out_data));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (out_data) {
|
||||
if (obj && obj->type == ACPI_TYPE_INTEGER)
|
||||
*out_data = (u32)obj->integer.value;
|
||||
else
|
||||
return -ENOMSG;
|
||||
}
|
||||
__le32 *data __free(kfree) = out.data;
|
||||
*out_data = le32_to_cpu(*data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user