aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2009-09-21 15:23:32 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-10-09 16:47:24 -0400
commitaa65d22ae6412f474e5ba23fc363137b6c53eef9 (patch)
treec6f6fc5e32e3bcca890c2e0b369c434e3b1eed86 /drivers/staging
parentb1f68dc1d610159db0e8546117d86657f35a03b5 (diff)
Staging: comedi: cb_pcidio: fix "section mismatch" error
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. Signed-off-by: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/drivers/cb_pcidio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/cb_pcidio.c b/drivers/staging/comedi/drivers/cb_pcidio.c
index 4d10bc31d461..09e6e3bdfb3e 100644
--- a/drivers/staging/comedi/drivers/cb_pcidio.c
+++ b/drivers/staging/comedi/drivers/cb_pcidio.c
@@ -53,7 +53,8 @@ Passing a zero for an option is the same as leaving it unspecified.
53 * Some drivers use arrays such as this, other do not. 53 * Some drivers use arrays such as this, other do not.
54 */ 54 */
55struct pcidio_board { 55struct pcidio_board {
56 const char *name; /* anme of the board */ 56 const char *name; /* name of the board */
57 int dev_id;
57 int n_8255; /* number of 8255 chips on board */ 58 int n_8255; /* number of 8255 chips on board */
58 59
59 /* indices of base address regions */ 60 /* indices of base address regions */
@@ -64,18 +65,21 @@ struct pcidio_board {
64static const struct pcidio_board pcidio_boards[] = { 65static const struct pcidio_board pcidio_boards[] = {
65 { 66 {
66 .name = "pci-dio24", 67 .name = "pci-dio24",
68 .dev_id = 0x0028,
67 .n_8255 = 1, 69 .n_8255 = 1,
68 .pcicontroler_badrindex = 1, 70 .pcicontroler_badrindex = 1,
69 .dioregs_badrindex = 2, 71 .dioregs_badrindex = 2,
70 }, 72 },
71 { 73 {
72 .name = "pci-dio24h", 74 .name = "pci-dio24h",
75 .dev_id = 0x0014,
73 .n_8255 = 1, 76 .n_8255 = 1,
74 .pcicontroler_badrindex = 1, 77 .pcicontroler_badrindex = 1,
75 .dioregs_badrindex = 2, 78 .dioregs_badrindex = 2,
76 }, 79 },
77 { 80 {
78 .name = "pci-dio48h", 81 .name = "pci-dio48h",
82 .dev_id = 0x000b,
79 .n_8255 = 2, 83 .n_8255 = 2,
80 .pcicontroler_badrindex = 0, 84 .pcicontroler_badrindex = 0,
81 .dioregs_badrindex = 1, 85 .dioregs_badrindex = 1,
@@ -206,7 +210,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
206 continue; 210 continue;
207 /* loop through cards supported by this driver */ 211 /* loop through cards supported by this driver */
208 for (index = 0; index < ARRAY_SIZE(pcidio_boards); index++) { 212 for (index = 0; index < ARRAY_SIZE(pcidio_boards); index++) {
209 if (pcidio_pci_table[index].device != pcidev->device) 213 if (pcidio_boards[index].dev_id != pcidev->device)
210 continue; 214 continue;
211 215
212 /* was a particular bus/slot requested? */ 216 /* was a particular bus/slot requested? */