]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: addi_apci_3xxx: simplify the PCI bar reading
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:07:25 +0000 (16:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:39 +0000 (14:33 -0700)
The boards supported by this driver all have an ADDIDATA_9054 eeprom.
Knowing this we can simplify the code that reads the PCI bars to get
the iobase address used by the driver.

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

index b0bde7509123e7573ff538eb88a10db835716775..0327facc408e3ce53de10a5d5d63d5f053ad4564 100644 (file)
@@ -718,23 +718,10 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       if (!board->pc_EepromChip ||
-           strcmp(board->pc_EepromChip, ADDIDATA_9054)) {
-               /* board does not have an eeprom or is not ADDIDATA_9054 */
-               if (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 {
-               /* board has an ADDIDATA_9054 eeprom */
-               dev->iobase = pci_resource_start(pcidev, 2);
-               devpriv->iobase = pci_resource_start(pcidev, 2);
-               devpriv->dw_AiBase = pci_ioremap_bar(pcidev, 3);
-       }
+       /* board has an ADDIDATA_9054 eeprom */
+       dev->iobase = pci_resource_start(pcidev, 2);
+       devpriv->iobase = pci_resource_start(pcidev, 2);
+       devpriv->dw_AiBase = pci_ioremap_bar(pcidev, 3);
        devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
 
        /* Initialize parameters that can be overridden in EEPROM */