]> Pileus Git - ~andy/linux/commitdiff
staging: comedi: addi_apci_1032: simplify the PCI bar reading
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 5 Nov 2012 21:36:53 +0000 (14:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Nov 2012 08:30:55 +0000 (09:30 +0100)
This board has a 93c76 eeprom. Knowing this information allows
simplifying the code that reads the PCI bars to get the iobase
addresses used in the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi_apci_1032.c

index 70cada42dd1b9f69d8a226209625f44cddbbe9fc..8ea9feac4e27c6ad9d8757773b3139fdcbf20195 100644 (file)
@@ -88,22 +88,10 @@ static int apci1032_attach_pci(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       if (!this_board->pc_EepromChip ||
-           !strcmp(this_board->pc_EepromChip, ADDIDATA_9054)) {
-               if (this_board->i_IorangeBase1)
-                       dev->iobase = pci_resource_start(pcidev, 1);
-               else
-                       dev->iobase = pci_resource_start(pcidev, 0);
-
-               devpriv->iobase = dev->iobase;
-               devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
-               devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
-       } else {
-               dev->iobase = pci_resource_start(pcidev, 2);
-               devpriv->iobase = pci_resource_start(pcidev, 2);
-               devpriv->dw_AiBase = ioremap(pci_resource_start(pcidev, 3),
-                                            this_board->i_IorangeBase3);
-       }
+       dev->iobase = pci_resource_start(pcidev, 2);
+       devpriv->iobase = pci_resource_start(pcidev, 2);
+       devpriv->dw_AiBase = ioremap(pci_resource_start(pcidev, 3),
+                                    this_board->i_IorangeBase3);
        devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
 
        /* Initialize parameters that can be overridden in EEPROM */