summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>2026-05-22 16:01:03 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-07 14:27:21 +0200
commit0f09902b05062749e4e5a7e4112f35f70b3f2feb (patch)
treede3a611cb435edf069fa4aafb33a6d3dff192996
parente508a176d86f5ca0916ac1caf80806f9ad3d91ef (diff)
serial: 8250_exar: Consistently define pci_device_ids using named initializers
The .driver_data member of the struct pci_device_id array were initialized by list expressions. This isn't easily readable if you're not into PCI, still more given that it's hidden in macros. Using named initializers is more explicit and thus easier to parse for a human. And it's also more robust against changes to the struct definition. The mentioned robustness is relevant for a planned change to struct pci_device_id that replaces .driver_data by an anonymous union. Also drop a few explicit zeros that are not needed and improve indention. This change doesn't introduce changes to the compiled pci_device_id array. Tested on x86 and arm64. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20260522140103.769262-2-u.kleine-koenig@baylibre.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/8250/8250_exar.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index c682c0d0dffa..f9a14eaa13cb 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -1642,14 +1642,14 @@ static const struct exar8250_board pbn_exar_XR17V8358 = {
.exit = pci_xr17v35x_exit,
};
-#define CTI_EXAR_DEVICE(devid, bd) { \
- PCI_DEVICE_SUB( \
- PCI_VENDOR_ID_EXAR, \
- PCI_DEVICE_ID_EXAR_##devid, \
- PCI_SUBVENDOR_ID_CONNECT_TECH, \
- PCI_ANY_ID), 0, 0, \
- (kernel_ulong_t)&bd \
- }
+#define CTI_EXAR_DEVICE(devid, bd) { \
+ PCI_DEVICE_SUB( \
+ PCI_VENDOR_ID_EXAR, \
+ PCI_DEVICE_ID_EXAR_##devid, \
+ PCI_SUBVENDOR_ID_CONNECT_TECH, \
+ PCI_ANY_ID), \
+ .driver_data = (kernel_ulong_t)&bd \
+}
#define EXAR_DEVICE(vend, devid, bd) { PCI_DEVICE_DATA(vend, devid, &bd) }
@@ -1658,18 +1658,18 @@ static const struct exar8250_board pbn_exar_XR17V8358 = {
PCI_VENDOR_ID_EXAR, \
PCI_DEVICE_ID_EXAR_##devid, \
PCI_SUBVENDOR_ID_IBM, \
- PCI_SUBDEVICE_ID_IBM_##sdevid), 0, 0, \
- (kernel_ulong_t)&bd \
- }
+ PCI_SUBDEVICE_ID_IBM_##sdevid), \
+ .driver_data = (kernel_ulong_t)&bd \
+}
#define USR_DEVICE(devid, sdevid, bd) { \
PCI_DEVICE_SUB( \
PCI_VENDOR_ID_USR, \
PCI_DEVICE_ID_EXAR_##devid, \
PCI_VENDOR_ID_EXAR, \
- PCI_SUBDEVICE_ID_USR_##sdevid), 0, 0, \
- (kernel_ulong_t)&bd \
- }
+ PCI_SUBDEVICE_ID_USR_##sdevid), \
+ .driver_data = (kernel_ulong_t)&bd \
+}
static const struct pci_device_id exar_pci_tbl[] = {
EXAR_DEVICE(ACCESSIO, COM_2S, pbn_exar_XR17C15x),
@@ -1726,7 +1726,7 @@ static const struct pci_device_id exar_pci_tbl[] = {
EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4),
EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4),
EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8),
- { 0, }
+ { }
};
MODULE_DEVICE_TABLE(pci, exar_pci_tbl);