staging: comedi: addi-data: use attach_pci callback
authorH Hartley Sweeten <hartleys@visionengravers.com>
Wed, 31 Oct 2012 23:57:37 +0000 (16:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Nov 2012 15:43:25 +0000 (08:43 -0700)
Use the comedi pci auto config mechanism to attach the addi-data
drivers. This allows removing all the PCI bus walking code.

Add a function, addi_find_boardinfo(), to find the driver specific
boardinfo. Since this function is currently in the common code we
have to use the pointer to the boardinfo that is stored in the
comedi_driver pointer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 files changed:
drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h
drivers/staging/comedi/drivers/addi-data/addi_common.c
drivers/staging/comedi/drivers/addi-data/addi_common.h
drivers/staging/comedi/drivers/addi_apci_035.c
drivers/staging/comedi/drivers/addi_apci_1032.c
drivers/staging/comedi/drivers/addi_apci_1500.c
drivers/staging/comedi/drivers/addi_apci_1516.c
drivers/staging/comedi/drivers/addi_apci_1564.c
drivers/staging/comedi/drivers/addi_apci_16xx.c
drivers/staging/comedi/drivers/addi_apci_1710.c
drivers/staging/comedi/drivers/addi_apci_2016.c
drivers/staging/comedi/drivers/addi_apci_2032.c
drivers/staging/comedi/drivers/addi_apci_2200.c
drivers/staging/comedi/drivers/addi_apci_3001.c
drivers/staging/comedi/drivers/addi_apci_3120.c
drivers/staging/comedi/drivers/addi_apci_3200.c
drivers/staging/comedi/drivers/addi_apci_3300.c
drivers/staging/comedi/drivers/addi_apci_3501.c
drivers/staging/comedi/drivers/addi_apci_3xxx.c

index 2011f4bb304682b0ae2a865b3a714ac6dd1a2c80..bef74792352c8cdf5cd51d31dbf27686337f1edb 100644 (file)
 #define TARGET_ABORT_INT       0x00200000L
 #define BUS_MASTER_INT         0x00200000L
 
-/****************************************************************************/
-
-struct pcilst_struct {
-       struct pcilst_struct *next;
-       int used;
-       struct pci_dev *pcidev;
-       unsigned short vendor;
-       unsigned short device;
-       unsigned char pci_bus;
-       unsigned char pci_slot;
-       unsigned char pci_func;
-};
-
-/* ptr to root list of all amcc devices */
-static struct pcilst_struct *amcc_devices;
-
-static const int i_ADDIDATADeviceID[] = { 0x15B8, 0x10E8 };
-
-/****************************************************************************/
-
-void v_pci_card_list_init(unsigned short pci_vendor);
-void v_pci_card_list_cleanup(unsigned short pci_vendor);
-struct pcilst_struct *ptr_find_free_pci_card_by_device(unsigned short vendor_id,
-                                                      unsigned short
-                                                      device_id);
-int i_find_free_pci_card_by_position(unsigned short vendor_id,
-                                    unsigned short device_id,
-                                    unsigned short pci_bus,
-                                    unsigned short pci_slot,
-                                    struct pcilst_struct **card);
-struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
-                                                   unsigned short device_id,
-                                                   unsigned short pci_bus,
-                                                   unsigned short pci_slot);
-
-/****************************************************************************/
-
-/* build list of amcc cards in this system */
-void v_pci_card_list_init(unsigned short pci_vendor)
-{
-       struct pci_dev *pcidev = NULL;
-       struct pcilst_struct *amcc, *last;
-       int i_Count = 0;
-       amcc_devices = NULL;
-       last = NULL;
-
-       for_each_pci_dev(pcidev) {
-               for (i_Count = 0; i_Count < 2; i_Count++) {
-                       pci_vendor = i_ADDIDATADeviceID[i_Count];
-                       if (pcidev->vendor == pci_vendor) {
-                               amcc = kzalloc(sizeof(*amcc), GFP_KERNEL);
-                               if (amcc == NULL)
-                                       continue;
-
-                               amcc->pcidev = pcidev;
-                               if (last)
-                                       last->next = amcc;
-                               else
-                                       amcc_devices = amcc;
-                               last = amcc;
-
-                               amcc->vendor = pcidev->vendor;
-                               amcc->device = pcidev->device;
-                               amcc->pci_bus = pcidev->bus->number;
-                               amcc->pci_slot = PCI_SLOT(pcidev->devfn);
-                               amcc->pci_func = PCI_FUNC(pcidev->devfn);
-                       }
-               }
-       }
-}
-
-/****************************************************************************/
-/* free up list of amcc cards in this system */
-void v_pci_card_list_cleanup(unsigned short pci_vendor)
-{
-       struct pcilst_struct *amcc, *next;
-
-       for (amcc = amcc_devices; amcc; amcc = next) {
-               next = amcc->next;
-               kfree(amcc);
-       }
-
-       amcc_devices = NULL;
-}
-
-/****************************************************************************/
-/* find first unused card with this device_id */
-struct pcilst_struct *ptr_find_free_pci_card_by_device(unsigned short vendor_id,
-                                                      unsigned short device_id)
-{
-       struct pcilst_struct *amcc, *next;
-
-       for (amcc = amcc_devices; amcc; amcc = next) {
-               next = amcc->next;
-               if ((!amcc->used) && (amcc->device == device_id)
-                   && (amcc->vendor == vendor_id))
-                       return amcc;
-
-       }
-
-       return NULL;
-}
-
-/****************************************************************************/
-/* find card on requested position */
-int i_find_free_pci_card_by_position(unsigned short vendor_id,
-                                    unsigned short device_id,
-                                    unsigned short pci_bus,
-                                    unsigned short pci_slot,
-                                    struct pcilst_struct **card)
-{
-       struct pcilst_struct *amcc, *next;
-
-       *card = NULL;
-       for (amcc = amcc_devices; amcc; amcc = next) {
-               next = amcc->next;
-               if ((amcc->vendor == vendor_id) && (amcc->device == device_id)
-                   && (amcc->pci_bus == pci_bus)
-                   && (amcc->pci_slot == pci_slot)) {
-                       if (!(amcc->used)) {
-                               *card = amcc;
-                               return 0;       /* ok, card is found */
-                       } else {
-                               printk(" - \nCard on requested position is used b:s %d:%d!\n",
-                                         pci_bus, pci_slot);
-                               return 2;       /* card exist but is used */
-                       }
-               }
-       }
-
-       /* no card found */
-       return 1;
-}
-
-/****************************************************************************/
-/* select and alloc card */
-struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
-                                                   unsigned short device_id,
-                                                   unsigned short pci_bus,
-                                                   unsigned short pci_slot)
-{
-       struct pcilst_struct *card;
-
-       if ((pci_bus < 1) & (pci_slot < 1)) {
-               /* use autodetection */
-               card = ptr_find_free_pci_card_by_device(vendor_id, device_id);
-               if (card == NULL) {
-                       printk(" - Unused card not found in system!\n");
-                       return NULL;
-               }
-       } else {
-               switch (i_find_free_pci_card_by_position(vendor_id, device_id,
-                                                        pci_bus, pci_slot,
-                                                        &card)) {
-               case 1:
-                       printk(" - Card not found on requested position b:s %d:%d!\n",
-                                 pci_bus, pci_slot);
-                       return NULL;
-               case 2:
-                       printk(" - Card on requested position is used b:s %d:%d!\n",
-                                 pci_bus, pci_slot);
-                       return NULL;
-               }
-       }
-
-       return card;
-}
 #endif
index f6c36ac93b2bf3554865e8671f9bb5241d62348e..5cfd85d429b6418a48fe0cb1d834de0f821dbb13 100644 (file)
@@ -36,11 +36,6 @@ You should also find the complete GPL in the COPYING file accompanying this sour
   +-----------------------------------------------------------------------+
   | Description : ADDI COMMON Main Module                                 |
   +-----------------------------------------------------------------------+
-  | CONFIG OPTIONS                                                        |
-  |    option[0] - PCI bus number - if bus number and slot number are 0, |
-  |                             then driver search for first unused card |
-  |    option[1] - PCI slot number                                       |
-  +----------+-----------+------------------------------------------------+
 */
 
 #ifndef COMEDI_SUBD_TTLIO
@@ -81,42 +76,49 @@ static int i_ADDI_Reset(struct comedi_device *dev)
        return 0;
 }
 
-static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
+static const void *addi_find_boardinfo(struct comedi_device *dev,
+                                      struct pci_dev *pcidev)
 {
-       const struct addi_board *this_board = comedi_board(dev);
-       struct pci_dev *pcidev;
+       const void *p = dev->driver->board_name;
+       const struct addi_board *this_board;
+       int i;
+
+       for (i = 0; i < dev->driver->num_names; i++) {
+               this_board = p;
+               if (this_board->i_VendorId == pcidev->vendor &&
+                   this_board->i_DeviceId == pcidev->device)
+                       return this_board;
+               p += dev->driver->offset;
+       }
+       return NULL;
+}
+
+static int addi_attach_pci(struct comedi_device *dev,
+                          struct pci_dev *pcidev)
+{
+       const struct addi_board *this_board;
        struct addi_private *devpriv;
        struct comedi_subdevice *s;
        int ret, pages, i, n_subdevices;
        unsigned int dw_Dummy;
        resource_size_t iobase_a, iobase_main, iobase_addon, iobase_reserved;
-       struct pcilst_struct *card = NULL;
+
+       this_board = addi_find_boardinfo(dev, pcidev);
+       if (!this_board)
+               return -ENODEV;
+       dev->board_ptr = this_board;
+       dev->board_name = this_board->pc_DriverName;
 
        devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
        if (!devpriv)
                return -ENOMEM;
        dev->private = devpriv;
 
-       if (!pci_list_builded) {
-               v_pci_card_list_init(this_board->i_VendorId);
-               pci_list_builded = 1;
-       }
-
-       card = ptr_select_and_alloc_pci_card(this_board->i_VendorId,
-                                            this_board->i_DeviceId,
-                                            it->options[0],
-                                            it->options[1]);
-
-       if (card == NULL)
-               return -EIO;
-       pcidev = card->pcidev;
-
-       ret = comedi_pci_enable(pcidev, "addi_amcc_s5933");
+       ret = comedi_pci_enable(pcidev, dev->board_name);
        if (ret)
                return ret;
        if (this_board->i_Dma)
                pci_set_master(pcidev);
-       card->used = 1;
        devpriv->allocated = 1;
 
        iobase_a = pci_resource_start(pcidev, 0);
@@ -136,16 +138,12 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
                        dev->iobase = (unsigned long)iobase_a;  /*  DAQ base address... */
                }
 
-               dev->board_name = this_board->pc_DriverName;
-               devpriv->amcc = card;
                devpriv->iobase = (int) dev->iobase;
                devpriv->i_IobaseAmcc = (int) iobase_a; /* AMCC base address... */
                devpriv->i_IobaseAddon = (int) iobase_addon;    /* ADD ON base address.... */
                devpriv->i_IobaseReserved = (int) iobase_reserved;
        } else {
-               dev->board_name = this_board->pc_DriverName;
                dev->iobase = pci_resource_start(pcidev, 2);
-               devpriv->amcc = card;
                devpriv->iobase = pci_resource_start(pcidev, 2);
                devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
                devpriv->dw_AiBase = ioremap(pci_resource_start(pcidev, 3),
@@ -171,7 +169,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        if (pcidev->irq > 0) {
                ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
-                                 this_board->pc_DriverName, dev);
+                                 dev->board_name, dev);
                if (ret == 0)
                        dev->irq = pcidev->irq;
        }
@@ -181,7 +179,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (this_board->i_PCIEeprom) {
                if (!(strcmp(this_board->pc_EepromChip, "S5920"))) {
                        /*  Set 3 wait stait */
-                       if (!(strcmp(this_board->pc_DriverName, "apci035"))) {
+                       if (!(strcmp(dev->board_name, "apci035"))) {
                                outl(0x80808082, devpriv->i_IobaseAmcc + 0x60);
                        } else {
                                outl(0x83838383, devpriv->i_IobaseAmcc + 0x60);
@@ -193,11 +191,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
                addi_eeprom_read_info(dev, pci_resource_start(pcidev, 0));
        }
 
-       if (it->options[2] > 0) {
-               devpriv->us_UseDma = ADDI_DISABLE;
-       } else {
-               devpriv->us_UseDma = ADDI_ENABLE;
-       }
+       devpriv->us_UseDma = ADDI_ENABLE;
 
        if (devpriv->s_EeParameters.i_Dma) {
                if (devpriv->us_UseDma == ADDI_ENABLE) {
@@ -231,7 +225,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
                }
        }
 
-       if (!strcmp(this_board->pc_DriverName, "apci1710")) {
+       if (!strcmp(dev->board_name, "apci1710")) {
 #ifdef CONFIG_APCI_1710
                i_ADDI_AttachPCI1710(dev);
 
@@ -393,6 +387,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
 static void i_ADDI_Detach(struct comedi_device *dev)
 {
        const struct addi_board *this_board = comedi_board(dev);
+       struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct addi_private *devpriv = dev->private;
 
        if (devpriv) {
@@ -402,10 +397,8 @@ static void i_ADDI_Detach(struct comedi_device *dev)
                        free_irq(dev->irq, dev);
                if ((this_board->pc_EepromChip == NULL) ||
                    (strcmp(this_board->pc_EepromChip, ADDIDATA_9054) != 0)) {
-                       if (devpriv->allocated) {
-                               comedi_pci_disable(devpriv->amcc->pcidev);
-                               devpriv->amcc->used = 0;
-                       }
+                       if (devpriv->allocated)
+                               comedi_pci_disable(pcidev);
                        if (devpriv->ul_DmaBufferVirtual[0]) {
                                free_pages((unsigned long)devpriv->
                                        ul_DmaBufferVirtual[0],
@@ -418,14 +411,8 @@ static void i_ADDI_Detach(struct comedi_device *dev)
                        }
                } else {
                        iounmap(devpriv->dw_AiBase);
-                       if (devpriv->allocated) {
-                               comedi_pci_disable(devpriv->amcc->pcidev);
-                               devpriv->amcc->used = 0;
-                       }
-               }
-               if (pci_list_builded) {
-                       v_pci_card_list_cleanup(this_board->i_VendorId);
-                       pci_list_builded = 0;
+                       if (devpriv->allocated)
+                               comedi_pci_disable(pcidev);
                }
        }
 }
index 6b71dbbfb22b0cc93ad50d222994e3c72c748ae3..c72e79d2c27dcc2ccbcc745ff30182b28f668ef4 100644 (file)
@@ -312,7 +312,6 @@ struct addi_private {
        int i_IobaseAddon;      /* addon base address */
        int i_IobaseReserved;
        void __iomem *dw_AiBase;
-       struct pcilst_struct *amcc;     /*  ptr too AMCC data */
        unsigned char allocated;                /*  we have blocked card */
        unsigned char b_ValidDriver;    /*  driver is ok */
        unsigned char b_AiContinuous;   /*  we do unlimited AI */
@@ -410,5 +409,3 @@ struct addi_private {
                                        /*  Minimum Delay in Nano secs */
        } s_EeParameters;
 };
-
-static unsigned short pci_list_builded;        /* set to 1 when list of card is known */
index 812092f7fbad4ada56bf92e9d79ff82fcbbc6a08..5403ae838f701cd6508fcf6b6eec96831aa738c8 100644 (file)
@@ -40,7 +40,7 @@ static const struct addi_board apci035_boardtypes[] = {
 static struct comedi_driver apci035_driver = {
        .driver_name    = "addi_apci_035",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci035_boardtypes),
        .board_name     = &apci035_boardtypes[0].pc_DriverName,
index f787604c311da8b68c1a18aab4386a5113a19c1f..2b63d0c3894666f261f5ad7ecf8b41e803431d04 100644 (file)
@@ -29,7 +29,7 @@ static const struct addi_board apci1032_boardtypes[] = {
 static struct comedi_driver apci1032_driver = {
        .driver_name    = "addi_apci_1032",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci1032_boardtypes),
        .board_name     = &apci1032_boardtypes[0].pc_DriverName,
index 51f9e85459c9034f41bdac8b13c1439e23c5748a..804ce736c487053359c67f37edc1880e9c22909b 100644 (file)
@@ -40,7 +40,7 @@ static const struct addi_board apci1500_boardtypes[] = {
 static struct comedi_driver apci1500_driver = {
        .driver_name    = "addi_apci_1500",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci1500_boardtypes),
        .board_name     = &apci1500_boardtypes[0].pc_DriverName,
index ba7ffad4534ec7422b1dc9cc6fd9c9daa377c335..480c285a8749f75a6631f9a324d36394a440475d 100644 (file)
@@ -36,7 +36,7 @@ static const struct addi_board apci1516_boardtypes[] = {
 static struct comedi_driver apci1516_driver = {
        .driver_name    = "addi_apci_1516",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci1516_boardtypes),
        .board_name     = &apci1516_boardtypes[0].pc_DriverName,
index c44007b0c9144f16ab74d79bdeffc5df93c9620f..10a7dbcbf9951ba40ddab09787de69c979454900 100644 (file)
@@ -39,7 +39,7 @@ static const struct addi_board apci1564_boardtypes[] = {
 static struct comedi_driver apci1564_driver = {
        .driver_name    = "addi_apci_1564",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci1564_boardtypes),
        .board_name     = &apci1564_boardtypes[0].pc_DriverName,
index 18182a14d2167dfecc20159691ace30c8142c3ea..b00e1a47cfff47dbbae8e7a156c1d9248de34021 100644 (file)
@@ -39,7 +39,7 @@ static const struct addi_board apci16xx_boardtypes[] = {
 static struct comedi_driver apci16xx_driver = {
        .driver_name    = "addi_apci_16xx",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci16xx_boardtypes),
        .board_name     = &apci16xx_boardtypes[0].pc_DriverName,
index ff0131710cc265c2641a4054ad1728e2636cddd8..8fae5b2f4f7fe687cfcd11604050eba8a53696f5 100644 (file)
@@ -39,7 +39,7 @@ static const struct addi_board apci1710_boardtypes[] = {
 static struct comedi_driver apci1710_driver = {
        .driver_name    = "addi_apci_1710",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci1710_boardtypes),
        .board_name     = &apci1710_boardtypes[0].pc_DriverName,
index 26426085f97c48ec436e94c5ba761c0a9324063b..e0420860a4dc7674fdeafb1bc2564faa3dad35c3 100644 (file)
@@ -33,7 +33,7 @@ static const struct addi_board apci2016_boardtypes[] = {
 static struct comedi_driver apci2016_driver = {
        .driver_name    = "addi_apci_2016",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci2016_boardtypes),
        .board_name     = &apci2016_boardtypes[0].pc_DriverName,
index 32214198a902539828a2696f0b64930c37e2056c..fd415248fb27cce1828d63b73adb8d87ab0a7336 100644 (file)
@@ -35,7 +35,7 @@ static const struct addi_board apci2032_boardtypes[] = {
 static struct comedi_driver apci2032_driver = {
        .driver_name    = "addi_apci_2032",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci2032_boardtypes),
        .board_name     = &apci2032_boardtypes[0].pc_DriverName,
index 6c8a22235202a217a2be04b4609beb50c0b17d24..3d4c9a9a840e24f8573ea66f65697dfb6cb422b9 100644 (file)
@@ -35,7 +35,7 @@ static const struct addi_board apci2200_boardtypes[] = {
 static struct comedi_driver apci2200_driver = {
        .driver_name    = "addi_apci_2200",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci2200_boardtypes),
        .board_name     = &apci2200_boardtypes[0].pc_DriverName,
index bfeac4451fb33b080bc9967debabee882a09532b..c875f8cdafda8fcdcb7b51057b1e3ccb7e61db39 100644 (file)
@@ -51,7 +51,7 @@ static const struct addi_board apci3001_boardtypes[] = {
 static struct comedi_driver apci3001_driver = {
        .driver_name    = "addi_apci_3001",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci3001_boardtypes),
        .board_name     = &apci3001_boardtypes[0].pc_DriverName,
index 1df67cea3472d109549d32f26f249a3cc267fa37..e027f4709cad70265635e99a65fb147481124879 100644 (file)
@@ -57,7 +57,7 @@ static const struct addi_board apci3120_boardtypes[] = {
 static struct comedi_driver apci3120_driver = {
        .driver_name    = "addi_apci_3120",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci3120_boardtypes),
        .board_name     = &apci3120_boardtypes[0].pc_DriverName,
index cc3e81426358646241aefe4b94a898c43167d1ce..28def40b83012e3b8820f2a09723478a9dec635f 100644 (file)
@@ -65,7 +65,7 @@ MODULE_DEVICE_TABLE(pci, apci3200_pci_table);
 static struct comedi_driver apci3200_driver = {
        .driver_name    = "addi_apci_3200",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci3200_boardtypes),
        .board_name     = &apci3200_boardtypes[0].pc_DriverName,
index 172b5ceed83c1a2884f2917cb604c8c410d1bda0..c57cacf0b32e4e139fa4466937d5b7892bb3071e 100644 (file)
@@ -58,7 +58,7 @@ static const struct addi_board apci3300_boardtypes[] = {
 static struct comedi_driver apci3300_driver = {
        .driver_name    = "addi_apci_3300",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci3300_boardtypes),
        .board_name     = &apci3300_boardtypes[0].pc_DriverName,
index 6543ba8682077d4b57ee85669ba37c03f77dbb72..35948161760a17bd68a4e36fda39b4cc9d7b6c92 100644 (file)
@@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, apci3501_pci_table);
 static struct comedi_driver apci3501_driver = {
        .driver_name    = "addi_apci_3501",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci3501_boardtypes),
        .board_name     = &apci3501_boardtypes[0].pc_DriverName,
index 86e17809b0243e5d88346a4a0f4c9d8d0831ce27..22b13987ea3dc776fd933570ef2c6f71dee4e7ab 100644 (file)
@@ -780,7 +780,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
 static struct comedi_driver apci3xxx_driver = {
        .driver_name    = "addi_apci_3xxx",
        .module         = THIS_MODULE,
-       .attach         = i_ADDI_Attach,
+       .attach_pci     = addi_attach_pci,
        .detach         = i_ADDI_Detach,
        .num_names      = ARRAY_SIZE(apci3xxx_boardtypes),
        .board_name     = &apci3xxx_boardtypes[0].pc_DriverName,