From 9138de6b6befaae36b1074ce01c37517aceda061 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 13 Nov 2012 13:46:04 -0700 Subject: [PATCH] staging: comedi: addi_apci_1516: add defines for the PCI device ids The PCI device ids supported by this driver are used multiple places in the code. To improve maintainability, create #define's for them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_1516.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1516.c b/drivers/staging/comedi/drivers/addi_apci_1516.c index c8156e1354bc..85ecd1a5229a 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1516.c +++ b/drivers/staging/comedi/drivers/addi_apci_1516.c @@ -33,6 +33,13 @@ #include "comedi_fc.h" /* + * PCI device ids supported by this driver + */ +#define PCI_DEVICE_ID_APCI1016 0x1000 +#define PCI_DEVICE_ID_APCI1516 0x1001 +#define PCI_DEVICE_ID_APCI2016 0x1002 + +/* * PCI bar 1 I/O Register map */ #define APCI1516_DI_REG 0x00 @@ -60,17 +67,17 @@ struct apci1516_boardinfo { static const struct apci1516_boardinfo apci1516_boardtypes[] = { { .name = "apci1016", - .device = 0x1000, + .device = PCI_DEVICE_ID_APCI1016, .di_nchan = 16, }, { .name = "apci1516", - .device = 0x1001, + .device = PCI_DEVICE_ID_APCI1516, .di_nchan = 8, .do_nchan = 8, .has_timer = 1, }, { .name = "apci2016", - .device = 0x1002, + .device = PCI_DEVICE_ID_APCI2016, .do_nchan = 16, .has_timer = 1, }, @@ -309,9 +316,9 @@ static void __devexit apci1516_pci_remove(struct pci_dev *dev) } static DEFINE_PCI_DEVICE_TABLE(apci1516_pci_table) = { - { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, 0x1000) }, - { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, 0x1001) }, - { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, 0x1002) }, + { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, PCI_DEVICE_ID_APCI1016) }, + { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, PCI_DEVICE_ID_APCI1516) }, + { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, PCI_DEVICE_ID_APCI2016) }, { 0 } }; MODULE_DEVICE_TABLE(pci, apci1516_pci_table); -- 2.11.0