From a28f8858ac059f43d87e5d557c7c6aa40061cb93 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Thu, 29 Oct 2020 12:09:48 +0100 Subject: [PATCH] uw_lightbar: Add compatible device check --- src/uniwill_keyboard.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index 33201c4..922af27 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -784,6 +784,14 @@ static struct led_classdev lightbar_led_classdevs[] = { static int uw_lightbar_init(struct platform_device *dev) { int i, j, status; + + bool lightbar_supported = false + || dmi_match(DMI_BOARD_NAME, "LAPQC71A") + || dmi_match(DMI_BOARD_NAME, "LAPQC71B") + ; + if (!lightbar_supported) + return -ENODEV; + for (i = 0; i < ARRAY_SIZE(lightbar_led_classdevs); ++i) { status = led_classdev_register(&dev->dev, &lightbar_led_classdevs[i]); if (status < 0) {