staging: comedi: addi_common.h: remove boardinfo 'i_IorangeBase1'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 Oct 2014 17:44:30 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:48:54 +0000 (15:48 +0800)
This member of the boardinfo is used as a flag to determine what PCI BAR
to use for the main 'iobase' used by the driver.

Remove the boardinfo member and refactor the (*auto_attach) of the drivers
to use the correct PCI BAR.

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-data/addi_common.h
drivers/staging/comedi/drivers/addi_apci_035.c
drivers/staging/comedi/drivers/addi_apci_1500.c

index 9def296568ffe36f1f1080cd7cc01b1a61a87960..0752a61a7c2aa5c61d8d00d93231b53773b6675f 100644 (file)
@@ -20,7 +20,6 @@
 
 struct addi_board {
        const char *name;
-       int i_IorangeBase1;
        int i_PCIEeprom;        /*  eeprom present or not */
        char *pc_EepromChip;    /*  type of chip */
        int i_NbrAiChannel;     /*  num of A/D chans */
index a5e3d325165a790c2ceac56ebd0f4023834dfdfc..a197f64e63c1f85b35fc7ca3f748f8a518ddfc38 100644 (file)
@@ -15,7 +15,6 @@
 static const struct addi_board apci035_boardtypes[] = {
        {
                .name                   = "apci035",
-               .i_IorangeBase1         = APCI035_ADDRESS_RANGE,
                .i_PCIEeprom            = 1,
                .pc_EepromChip          = "S5920",
                .i_NbrAiChannel         = 16,
@@ -67,11 +66,7 @@ static int apci035_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       if (this_board->i_IorangeBase1)
-               dev->iobase = pci_resource_start(pcidev, 1);
-       else
-               dev->iobase = pci_resource_start(pcidev, 0);
-
+       dev->iobase = pci_resource_start(pcidev, 1);
        devpriv->iobase = dev->iobase;
        devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
        devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
index 03e65a106816512f5dea0f812bbbe16d95eded4e..c69510bcf931e33037afb2f775d2359374c29de8 100644 (file)
@@ -13,7 +13,6 @@
 static const struct addi_board apci1500_boardtypes[] = {
        {
                .name                   = "apci1500",
-               .i_IorangeBase1         = APCI1500_ADDRESS_RANGE,
                .i_PCIEeprom            = 0,
                .i_NbrDiChannel         = 16,
                .i_NbrDoChannel         = 16,
@@ -60,11 +59,7 @@ static int apci1500_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       if (this_board->i_IorangeBase1)
-               dev->iobase = pci_resource_start(pcidev, 1);
-       else
-               dev->iobase = pci_resource_start(pcidev, 0);
-
+       dev->iobase = pci_resource_start(pcidev, 1);
        devpriv->iobase = dev->iobase;
        devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
        devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);