All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] WMI: fix the incorrect wmi device may be chosen from BIOS's notification if multiple wmi devices exist in a system.
@ 2012-07-19  1:43 Alex Hung
  2012-07-28  4:15 ` Matthew Garrett
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Hung @ 2012-07-19  1:43 UTC (permalink / raw)
  To: alex.hung, mjg, platform-driver-x86

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 drivers/platform/x86/wmi.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index a134c26..efc920b 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -114,6 +114,8 @@ static struct acpi_driver acpi_wmi_driver = {
 	},
 };
 
+static struct acpi_device *wmi_device;
+
 /*
  * GUID parsing functions
  */
@@ -652,8 +654,9 @@ acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out)
 
 	list_for_each(p, &wmi_block_list) {
 		wblock = list_entry(p, struct wmi_block, list);
+		if (wmi_device != NULL && wmi_device->handle != wblock->handle)
+			continue;
 		gblock = &wblock->gblock;
-
 		if ((gblock->flags & ACPI_WMI_EVENT) &&
 			(gblock->notify_id == event))
 			return acpi_evaluate_object(wblock->handle, "_WED",
@@ -900,6 +903,10 @@ static void acpi_wmi_notify(struct acpi_device *device, u32 event)
 		wblock = list_entry(p, struct wmi_block, list);
 		block = &wblock->gblock;
 
+		if (device->handle != wblock->handle)
+			continue;
+		wmi_device = device;
+
 		if ((block->flags & ACPI_WMI_EVENT) &&
 			(block->notify_id == event)) {
 			if (wblock->handler)
-- 
1.7.9.5

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

end of thread, other threads:[~2012-07-31  7:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-19  1:43 [PATCH] WMI: fix the incorrect wmi device may be chosen from BIOS's notification if multiple wmi devices exist in a system Alex Hung
2012-07-28  4:15 ` Matthew Garrett
2012-07-31  7:22   ` Alex Hung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.