staging: comedi: addi_apci_3xxx: remove need for s_EeParameters
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:09:29 +0000 (16:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:40 +0000 (14:33 -0700)
The boards supported by this driver do not have an eeprom. Remove the
need for the devpriv->s_EeParameters values by just using the values
from the boardinfo directly.

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/hwdrv_apci3xxx.c
drivers/staging/comedi/drivers/addi_apci_3xxx.c

index b493d0c9e46c33e0245ea32dd4a4d36d27b7be11..08dce6095294d14c60092dd282bc1e0d957d11bc 100644 (file)
@@ -172,13 +172,12 @@ static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev,
                 /*******************************/
 
                                if (dw_TestReloadValue >=
-                                       devpriv->s_EeParameters.
-                                       ui_MinAcquisitiontimeNs) {
+                                   this_board->ui_MinAcquisitiontimeNs) {
                                        if ((b_SingleDiff == APCI3XXX_SINGLE)
                                                || (b_SingleDiff ==
                                                        APCI3XXX_DIFF)) {
                                                if (((b_SingleDiff == APCI3XXX_SINGLE)
-                                                       && (devpriv->s_EeParameters.i_NbrAiChannel == 0))
+                                                       && (this_board->i_NbrAiChannel == 0))
                                                    || ((b_SingleDiff == APCI3XXX_DIFF)
                                                        && (this_board->i_NbrAiChannelDiff == 0))
                                                    ) {
@@ -385,7 +384,7 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev,
                /* Test the channel number */
           /***************************/
 
-               if (((b_Channel < devpriv->s_EeParameters.i_NbrAiChannel)
+               if (((b_Channel < this_board->i_NbrAiChannel)
                                && (devpriv->b_SingelDiff == APCI3XXX_SINGLE))
                        || ((b_Channel < this_board->i_NbrAiChannelDiff)
                                && (devpriv->b_SingelDiff == APCI3XXX_DIFF))) {
@@ -596,6 +595,7 @@ static int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device *dev,
                                            struct comedi_insn *insn,
                                            unsigned int *data)
 {
+       const struct addi_board *board = comedi_board(dev);
        struct addi_private *devpriv = dev->private;
        unsigned char b_Range = (unsigned char) CR_RANGE(insn->chanspec);
        unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec);
@@ -611,7 +611,7 @@ static int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device *dev,
                /* Test the channel number */
           /***************************/
 
-               if (b_Channel < devpriv->s_EeParameters.i_NbrAoChannel) {
+               if (b_Channel < board->i_NbrAoChannel) {
              /**********************************/
                        /* Test the channel configuration */
              /**********************************/
index 7897a5129c8dd9daedd5dc480233478be804e2f9..f7c95ae66c56678eb7479290a56b2d178b7a3cc5 100644 (file)
@@ -641,19 +641,6 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
        devpriv->dw_AiBase = pci_ioremap_bar(pcidev, 3);
        devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
 
-       /* Initialize parameters that can be overridden in EEPROM */
-       devpriv->s_EeParameters.i_NbrAiChannel = board->i_NbrAiChannel;
-       devpriv->s_EeParameters.i_NbrAoChannel = board->i_NbrAoChannel;
-       devpriv->s_EeParameters.i_AiMaxdata = board->i_AiMaxdata;
-       devpriv->s_EeParameters.i_AoMaxdata = board->i_AoMaxdata;
-       devpriv->s_EeParameters.i_NbrDiChannel = board->i_NbrDiChannel;
-       devpriv->s_EeParameters.i_NbrDoChannel = board->i_NbrDoChannel;
-       devpriv->s_EeParameters.ui_MinAcquisitiontimeNs =
-                                               board->ui_MinAcquisitiontimeNs;
-       devpriv->s_EeParameters.ui_MinDelaytimeNs = board->ui_MinDelaytimeNs;
-
-       /* ## */
-
        if (pcidev->irq > 0) {
                ret = request_irq(pcidev->irq, apci3xxx_irq_handler,
                                  IRQF_SHARED, dev->board_name, dev);
@@ -668,20 +655,19 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
 
        /*  Allocate and Initialise AI Subdevice Structures */
        s = &dev->subdevices[0];
-       if (devpriv->s_EeParameters.i_NbrAiChannel ||
-           board->i_NbrAiChannelDiff) {
+       if (board->i_NbrAiChannel || board->i_NbrAiChannelDiff) {
                dev->read_subdev = s;
                s->type = COMEDI_SUBD_AI;
                s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND |
                                  SDF_DIFF;
-               if (devpriv->s_EeParameters.i_NbrAiChannel) {
-                       s->n_chan = devpriv->s_EeParameters.i_NbrAiChannel;
+               if (board->i_NbrAiChannel) {
+                       s->n_chan = board->i_NbrAiChannel;
                        devpriv->b_SingelDiff = 0;
                } else {
                        s->n_chan = board->i_NbrAiChannelDiff;
                        devpriv->b_SingelDiff = 1;
                }
-               s->maxdata = devpriv->s_EeParameters.i_AiMaxdata;
+               s->maxdata = board->i_AiMaxdata;
                s->len_chanlist = board->i_AiChannelList;
                s->range_table = &apci3xxx_ai_range;
 
@@ -702,12 +688,11 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
 
        /*  Allocate and Initialise AO Subdevice Structures */
        s = &dev->subdevices[1];
-       if (devpriv->s_EeParameters.i_NbrAoChannel) {
+       if (board->i_NbrAoChannel) {
                s->type = COMEDI_SUBD_AO;
                s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = devpriv->s_EeParameters.i_NbrAoChannel;
-               s->maxdata = devpriv->s_EeParameters.i_AoMaxdata;
-               s->len_chanlist = devpriv->s_EeParameters.i_NbrAoChannel;
+               s->n_chan = board->i_NbrAoChannel;
+               s->maxdata = board->i_AoMaxdata;
                s->range_table = &apci3xxx_ao_range;
                s->insn_config = board->ao_config;
                s->insn_write = board->ao_write;
@@ -716,12 +701,11 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
        }
        /*  Allocate and Initialise DI Subdevice Structures */
        s = &dev->subdevices[2];
-       if (devpriv->s_EeParameters.i_NbrDiChannel) {
+       if (board->i_NbrDiChannel) {
                s->type = COMEDI_SUBD_DI;
                s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = devpriv->s_EeParameters.i_NbrDiChannel;
+               s->n_chan = board->i_NbrDiChannel;
                s->maxdata = 1;
-               s->len_chanlist = devpriv->s_EeParameters.i_NbrDiChannel;
                s->range_table = &range_digital;
                s->io_bits = 0; /* all bits input */
                s->insn_bits = apci3xxx_di_insn_bits;
@@ -730,13 +714,12 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
        }
        /*  Allocate and Initialise DO Subdevice Structures */
        s = &dev->subdevices[3];
-       if (devpriv->s_EeParameters.i_NbrDoChannel) {
+       if (board->i_NbrDoChannel) {
                s->type = COMEDI_SUBD_DO;
                s->subdev_flags =
                        SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = devpriv->s_EeParameters.i_NbrDoChannel;
+               s->n_chan = board->i_NbrDoChannel;
                s->maxdata = 1;
-               s->len_chanlist = devpriv->s_EeParameters.i_NbrDoChannel;
                s->range_table = &range_digital;
                s->io_bits = 0xf;       /* all bits output */
                s->insn_bits = apci3xxx_do_insn_bits;