Skip to content

Commit 161e3be

Browse files
andy-shevlag-linaro
authored andcommitted
leds: nic78bx: Tidy up ACPI ID table
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>
1 parent 52fc807 commit 161e3be

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

drivers/leds/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,8 @@ config LEDS_USER
924924
config LEDS_NIC78BX
925925
tristate "LED support for NI PXI NIC78bx devices"
926926
depends on LEDS_CLASS
927-
depends on X86 && ACPI
927+
depends on HAS_IOPORT
928+
depends on X86 || COMPILE_TEST
928929
help
929930
This option enables support for the User1 and User2 LEDs on NI
930931
PXI NIC78bx devices.

drivers/leds/leds-nic78bx.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
* Copyright (C) 2016 National Instruments Corp.
44
*/
55

6-
#include <linux/acpi.h>
6+
#include <linux/array_size.h>
7+
#include <linux/bits.h>
8+
#include <linux/container_of.h>
9+
#include <linux/device.h>
10+
#include <linux/errno.h>
11+
#include <linux/io.h>
12+
#include <linux/ioport.h>
713
#include <linux/leds.h>
14+
#include <linux/mod_devicetable.h>
815
#include <linux/module.h>
916
#include <linux/platform_device.h>
1017
#include <linux/spinlock.h>
18+
#include <linux/types.h>
1119

1220
#define NIC78BX_USER1_LED_MASK 0x3
1321
#define NIC78BX_USER1_GREEN_LED BIT(0)
@@ -181,16 +189,16 @@ static int nic78bx_probe(struct platform_device *pdev)
181189
}
182190

183191
static const struct acpi_device_id led_device_ids[] = {
184-
{"NIC78B3", 0},
185-
{"", 0},
192+
{ "NIC78B3" },
193+
{ }
186194
};
187195
MODULE_DEVICE_TABLE(acpi, led_device_ids);
188196

189197
static struct platform_driver led_driver = {
190198
.probe = nic78bx_probe,
191199
.driver = {
192200
.name = KBUILD_MODNAME,
193-
.acpi_match_table = ACPI_PTR(led_device_ids),
201+
.acpi_match_table = led_device_ids,
194202
},
195203
};
196204

0 commit comments

Comments
 (0)