Skip to content

Commit c6ef061

Browse files
committed
x86: add driver for Lenovo ideapad S10-3T rotate button (v2)
Provided by Javier S. Pedro. (v2) Changes due to following commits: 79a56f4 "platform/x86: wmi: Remove wmi_get_event_data()" e04e2b7 "platform/x86: wmi: Pass event data directly to legacy notify handlers" Fixes the following building errors: ./kernel/drivers/platform/x86/lsrot.c:134:11: error: implicit declaration of function 'wmi_get_event_data' is invalid in C9 9 [-Werror,-Wimplicit-function-declaration] status = wmi_get_event_data(value, &response); ^ CC [M] drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.o ./kernel/drivers/platform/x86/lsrot.c:206:38: error: incompatible function pointer types passing 'void (u32, void *)' (aka 'void (unsigned int, void *)') to parameter of type 'wmi_notify_handler' (aka 'void (*)(union acpi_object *, void *)') [-Werror,-Wincompatible-func tion-pointer-types] event_handler, NULL); ^~~~~~~~~~~~~ ./kernel/include/linux/acpi.h:404:25: note: passing argument to parameter 'handler' here wmi_notify_handler handler, void *data); ^ 2 errors generated.
1 parent 9e1687e commit c6ef061

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

drivers/platform/x86/lsrot.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,8 @@ static int set_ap_bit(int ap, bool enabled)
125125
return 0;
126126
}
127127

128-
static void event_handler(u32 value, void *context)
128+
static void event_handler(union acpi_object *obj, void *context)
129129
{
130-
struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
131-
union acpi_object *obj;
132-
acpi_status status;
133-
134-
status = wmi_get_event_data(value, &response);
135-
if (ACPI_FAILURE(status)) {
136-
printk(KERN_WARNING "%s: bad event\n", DRIVER_NAME);
137-
return;
138-
}
139-
140-
obj = (union acpi_object *)response.pointer;
141-
142130
if (obj && obj->type == ACPI_TYPE_BUFFER && obj->buffer.length == 0x40) {
143131
u8 * data = (u8*) obj->buffer.pointer;
144132
switch (EVID(data)) {
@@ -159,8 +147,6 @@ static void event_handler(u32 value, void *context)
159147
} else {
160148
printk(KERN_WARNING "%s: bad event\n", DRIVER_NAME);
161149
}
162-
163-
kfree(obj);
164150
}
165151

166152
static int __init lsrot_init_module (void)

0 commit comments

Comments
 (0)