diff mbox series

[1/6] platform/x86: dell-smo8800: Only load on Dell laptops

Message ID 20231224213629.395741-2-hdegoede@redhat.com
State New
Headers show
Series i2c-i801 / dell-smo8800: Move instantiation of lis3lv02d i2c_client from i2c-i801 to dell-smo8800 | expand

Commit Message

Hans de Goede Dec. 24, 2023, 9:36 p.m. UTC
The SMO8xxx ACPI HIDs are generic accelerometer ids which are also used
by other vendors. Add a sys_vendor check to ensure that the dell-smo8800
driver only loads on Dell laptops.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/dell/dell-smo8800.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/platform/x86/dell/dell-smo8800.c b/drivers/platform/x86/dell/dell-smo8800.c
index f7ec17c56833..4d5f778fb599 100644
--- a/drivers/platform/x86/dell/dell-smo8800.c
+++ b/drivers/platform/x86/dell/dell-smo8800.c
@@ -10,6 +10,7 @@ 
 
 #define DRIVER_NAME "smo8800"
 
+#include <linux/dmi.h>
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
@@ -108,6 +109,9 @@  static int smo8800_probe(struct platform_device *device)
 	int err;
 	struct smo8800_device *smo8800;
 
+	if (!dmi_match(DMI_SYS_VENDOR, "Dell Inc."))
+		return false;
+
 	smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL);
 	if (!smo8800) {
 		dev_err(&device->dev, "failed to allocate device data\n");