platform/x86: wmi: Allow duplicate GUIDs for drivers that use struct wmi_driver
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 29 Aug 2022 20:14:59 +0000 (15:14 -0500)
committerHans de Goede <hdegoede@redhat.com>
Sat, 3 Sep 2022 11:11:40 +0000 (13:11 +0200)
commit134038b075cb1dae21623499d765973d286ac94a
tree9c7f3e1e4fba744e22a2885fa1fe7916f6833c51
parenta2bdf10ce96efbccabdad7216db5587c1213996c
platform/x86: wmi: Allow duplicate GUIDs for drivers that use struct wmi_driver

The WMI subsystem in the kernel currently tracks WMI devices by
a GUID string not by ACPI device.  The GUID used by the `wmi-bmof`
module however is available from many devices on nearly every machine.

This originally was thought to be a bug, but as it happens on most
machines it is a design mistake.  It has been fixed by tying an ACPI
device to the driver with struct wmi_driver. So drivers that have
moved over to struct wmi_driver can actually support multiple
instantiations of a GUID without any problem.

Add an allow list into wmi.c for GUIDs that the drivers that are known
to use struct wmi_driver.  The list is populated with `wmi-bmof` right
now. The additional instances of that in sysfs with be suffixed with -%d

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220829201500.6341-1-mario.limonciello@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/wmi.c