[PATCH net-next] atm: solos-pci: Simplify initialisation of pci_device_id array
From: Uwe Kleine-König (The Capable Hub)
Date: Mon May 04 2026 - 11:15:57 EST
Use the convenience macro PCI_DEVICE to initialize .vendor, .device,
.subvendor and .subdevice. Drop explicit zeros that the compiler also
fills in.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
---
Hello,
The secret plan is to make struct pci_device_id::driver_data an
anonymous union (similar to
https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@xxxxxxxxxxxx/)
and that requires named initializers. But IMHO it's also a nice cleanup
on its own.
The anonymous union will allow changes like the following:
- { PCI_DEVICE(0x8086, 0x8108), .driver_data = (long) &psb_chip_ops },
+ { PCI_DEVICE(0x8086, 0x8108), .driver_data_ptr = &psb_chip_ops },
(together with the respective change in the code when the value is
used). This gets rid of a bunch of casts and thus slightly improves
type safety. But that doesn't affect drivers/atm as here no pointers
are used as driver data. Still this driver needs adaption to work with
the changed definition of pci_device_id.
Best regards
Uwe
drivers/atm/solos-pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 24c764664c24..bcb1353877e4 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -1464,8 +1464,8 @@ static void fpga_remove(struct pci_dev *dev)
}
static const struct pci_device_id fpga_pci_tbl[] = {
- { 0x10ee, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
- { 0, }
+ { PCI_DEVICE(0x10ee, 0x0300) },
+ { }
};
MODULE_DEVICE_TABLE(pci,fpga_pci_tbl);
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
--
2.47.3