From 5fdc68d6fa35e2590b5b6a4a6e088486b859ce4a Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 7 Aug 2009 13:08:59 +0000 Subject: [PATCH] Store PCI device IDs in the board info and use this for matching IDs in the code instead of using the module device table. This avoids a "section mismatch" error. --- comedi/drivers/cb_pcidio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/cb_pcidio.c b/comedi/drivers/cb_pcidio.c index 455c8d88..3512fc02 100644 --- a/comedi/drivers/cb_pcidio.c +++ b/comedi/drivers/cb_pcidio.c @@ -53,7 +53,8 @@ Passing a zero for an option is the same as leaving it unspecified. * Some drivers use arrays such as this, other do not. */ typedef struct pcidio_board_struct { - const char *name; // anme of the board + const char *name; // name of the board + int dev_id; int n_8255; // number of 8255 chips on board // indices of base address regions @@ -64,18 +65,21 @@ typedef struct pcidio_board_struct { static const pcidio_board pcidio_boards[] = { { name: "pci-dio24", + dev_id: 0x0028, n_8255: 1, pcicontroler_badrindex:1, dioregs_badrindex:2, }, { name: "pci-dio24h", + dev_id: 0x0014, n_8255: 1, pcicontroler_badrindex:1, dioregs_badrindex:2, }, { name: "pci-dio48h", + dev_id: 0x000b, n_8255: 2, pcicontroler_badrindex:0, dioregs_badrindex:1, @@ -199,7 +203,7 @@ static int pcidio_attach(comedi_device * dev, comedi_devconfig * it) for (index = 0; index < sizeof pcidio_boards / sizeof(pcidio_board); index++) { - if (pcidio_pci_table[index].device != pcidev->device) + if (pcidio_boards[index].dev_id != pcidev->device) continue; // was a particular bus/slot requested? -- 2.26.2