]> www.infradead.org Git - nvme.git/commitdiff
leds: nic78bx: Tidy up ACPI ID table
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 13 Mar 2025 16:16:30 +0000 (18:16 +0200)
committerLee Jones <lee@kernel.org>
Fri, 21 Mar 2025 09:49:37 +0000 (09:49 +0000)
Tidy up ACPI ID table:

- Drop ACPI_PTR() and hence replace acpi.h with mod_devicetable.h and
  other necessary headers

- Remove explicit driver_data initializer

- Drop comma in the terminator entry

With that done, extend compile test coverage.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250313161630.415515-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/Kconfig
drivers/leds/leds-nic78bx.c

index 4f30e89e7e86323d771d2fb57d5fb279213b97f3..ddbe9dcdaf81e5779d043681a8c813d9eefa0fcc 100644 (file)
@@ -924,7 +924,8 @@ config LEDS_USER
 config LEDS_NIC78BX
        tristate "LED support for NI PXI NIC78bx devices"
        depends on LEDS_CLASS
-       depends on X86 && ACPI
+       depends on HAS_IOPORT
+       depends on X86 || COMPILE_TEST
        help
          This option enables support for the User1 and User2 LEDs on NI
          PXI NIC78bx devices.
index 282d9e4cf116f8940da3c3ea5e49d3f44d9c4b87..f3161266b8ad4eb301c1b73dedff2ebdce25b70f 100644 (file)
@@ -3,11 +3,19 @@
  * Copyright (C) 2016 National Instruments Corp.
  */
 
-#include <linux/acpi.h>
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/container_of.h>
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
 #include <linux/leds.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
+#include <linux/types.h>
 
 #define NIC78BX_USER1_LED_MASK         0x3
 #define NIC78BX_USER1_GREEN_LED                BIT(0)
@@ -181,8 +189,8 @@ static int nic78bx_probe(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id led_device_ids[] = {
-       {"NIC78B3", 0},
-       {"", 0},
+       { "NIC78B3" },
+       { }
 };
 MODULE_DEVICE_TABLE(acpi, led_device_ids);
 
@@ -190,7 +198,7 @@ static struct platform_driver led_driver = {
        .probe = nic78bx_probe,
        .driver = {
                .name = KBUILD_MODNAME,
-               .acpi_match_table = ACPI_PTR(led_device_ids),
+               .acpi_match_table = led_device_ids,
        },
 };