staging: comedi: adl_pci9118: remove PCI9118_PARANOIDCHECK code
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Sep 2014 20:05:34 +0000 (13:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Sep 2014 21:34:24 +0000 (14:34 -0700)
The comment states that paramoid checks are broken. They also would only
work for 12-bit analog input samples.

Instead of fixing the paranoid checking just remove it to simplify the
driver a bit.

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/adl_pci9118.c

index a5a59ee827e9b56ffc91db7fb04e18543bc1b1ec..dc5901493c9dcd895efbd71d22e7371e86dbab90 100644 (file)
 #include "8253.h"
 #include "comedi_fc.h"
 
-/* paranoid checks are broken */
-#undef PCI9118_PARANOIDCHECK   /*
-                                * if defined, then is used code which control
-                                * correct channel number on every 12 bit sample
-                                */
-
 #define IORANGE_9118   64      /* I hope */
 #define PCI9118_CHANLEN        255     /*
                                 * len of chanlist, some source say 256,
@@ -214,13 +208,6 @@ struct pci9118_private {
        unsigned long iobase_a; /* base+size for AMCC chip */
        unsigned int master;    /* master capable */
        unsigned int usemux;    /* we want to use external multiplexor! */
-#ifdef PCI9118_PARANOIDCHECK
-       unsigned short chanlist[PCI9118_CHANLEN + 1];   /*
-                                                        * list of
-                                                        * scanned channel
-                                                        */
-       unsigned char chanlistlen;      /* number of scanlist */
-#endif
        unsigned char ai_ctrl;
        unsigned char int_ctrl;
        unsigned char ai_cfg;
@@ -429,12 +416,6 @@ static int setup_channel_list(struct comedi_device *dev,
        outl(0, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
        outl(1, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
 
-#ifdef PCI9118_PARANOIDCHECK
-       devpriv->chanlistlen = n_chan;
-       for (i = 0; i < (PCI9118_CHANLEN + 1); i++)
-               devpriv->chanlist[i] = 0x55aa;
-#endif
-
        if (frontadd) {         /* insert channels for S&H */
                ssh = devpriv->softsshsample;
                for (i = 0; i < frontadd; i++) {
@@ -452,9 +433,6 @@ static int setup_channel_list(struct comedi_device *dev,
 
        for (i = 0; i < n_chan; i++) {  /* store range list to card */
                scanquad = CR_CHAN(chanlist[i]);        /* get channel number */
-#ifdef PCI9118_PARANOIDCHECK
-               devpriv->chanlist[i ^ usedma] = (scanquad & 0xf) << rot;
-#endif
                gain = CR_RANGE(chanlist[i]);           /* get gain number */
                scanquad |= ((gain & 0x03) << 8);
                outl(scanquad | ssh, dev->iobase + PCI9118_AI_CHANLIST_REG);
@@ -470,10 +448,6 @@ static int setup_channel_list(struct comedi_device *dev,
                             dev->iobase + PCI9118_AI_CHANLIST_REG);
                }
        }
-#ifdef PCI9118_PARANOIDCHECK
-       devpriv->chanlist[n_chan ^ usedma] = devpriv->chanlist[0 ^ usedma];
-                                               /* for 32bit operations */
-#endif
        /* close scan queue */
        outl(0, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
        /* udelay(100); important delay, or first sample will be crippled */
@@ -698,19 +672,6 @@ static void interrupt_pci9118_ai_onesample(struct comedi_device *dev,
 
        sampl = inl(dev->iobase + PCI9118_AI_FIFO_REG);
 
-#ifdef PCI9118_PARANOIDCHECK
-       if (s->maxdata != 0xffff) {
-               if ((sampl & 0x000f) != devpriv->chanlist[s->async->cur_chan]) {
-                                                       /* data dropout! */
-                       dev_info(dev->class_dev,
-                                "A/D  SAMPL - data dropout: received channel %d, expected %d!\n",
-                                sampl & 0x000f,
-                                devpriv->chanlist[s->async->cur_chan]);
-                       s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
-                       return;
-               }
-       }
-#endif
        cfc_write_to_buffer(s, sampl);
        s->async->cur_chan++;
        if (s->async->cur_chan >= cmd->scan_end_arg) {