platform/x86: wmi: Do not instantiate older WMI drivers multiple times
authorArmin Wolf <W_Armin@gmx.de>
Mon, 26 Feb 2024 19:35:56 +0000 (20:35 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 12 Mar 2024 10:47:35 +0000 (12:47 +0200)
commita66ccfc2535418b536b1203b65f87c4f501f6bdd
tree6f6e2c0f2ff5de5e7fd26ef3763ea9fd9ea5d989
parent928439582b3133a5e845ec15ee6eb6838651024f
platform/x86: wmi: Do not instantiate older WMI drivers multiple times

Many older WMI drivers cannot be instantiated multiple times for
two reasons:

- they are using the legacy GUID-based WMI API
- they are singletons (with global state)

Prevent such WMI drivers from binding to WMI devices with a duplicated
GUID, as this would mean that the WMI driver will be instantiated at
least two times (one for the original GUID and one for the duplicated
GUID).
WMI drivers which can be instantiated multiple times can signal this
by setting a flag inside struct wmi_driver.

Tested on a ASUS Prime B650-Plus.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240226193557.2888-2-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/hwmon/dell-smm-hwmon.c
drivers/platform/x86/dell/dell-wmi-ddv.c
drivers/platform/x86/intel/wmi/sbl-fw-update.c
drivers/platform/x86/intel/wmi/thunderbolt.c
drivers/platform/x86/wmi-bmof.c
drivers/platform/x86/wmi.c
include/linux/wmi.h