staging: comedi: drivers: remove inappropriate COMEDI_CB_EOA events
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 20 Jan 2015 19:06:02 +0000 (12:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 11:59:09 +0000 (19:59 +0800)
Hardware errors should be reported with the COMEDI_CB_ERROR event. This event
will cause the async command to cancel. It's not necessary to also set the
COMEDI_CB_EOA event. Remove these events.

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>
18 files changed:
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/das16m1.c
drivers/staging/comedi/drivers/das1800.c
drivers/staging/comedi/drivers/das800.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/gsc_hpdi.c
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/ni_at_a2150.c
drivers/staging/comedi/drivers/ni_labpc_common.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/pcl818.c
drivers/staging/comedi/drivers/quatech_daqp_cs.c

index 47f6c0e9f014faaee61b1c5ee15530060c709f98..f68dc99f8e277a2031f12dff57090b2f1a76c6e0 100644 (file)
@@ -539,7 +539,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
                        spin_unlock_irqrestore(&dev->spinlock, irq_flags);
                        dev_dbg(dev->class_dev, "fifo overflow\n");
                        outb(0, dev->iobase + PCI9111_INT_CLR_REG);
-                       async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                       async->events |= COMEDI_CB_ERROR;
                        comedi_handle_events(dev, s);
 
                        return IRQ_HANDLED;
index 26603582e71a54d36f1eb79465586e5ba7be6866..f61e392c2d3ef4ba93be7708d48ac17ab1343bb5 100644 (file)
@@ -749,13 +749,13 @@ static irqreturn_t pci9118_interrupt(int irq, void *d)
 
        if (intcsr & MASTER_ABORT_INT) {
                dev_err(dev->class_dev, "AMCC IRQ - MASTER DMA ABORT!\n");
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
                goto interrupt_exit;
        }
 
        if (intcsr & TARGET_ABORT_INT) {
                dev_err(dev->class_dev, "AMCC IRQ - TARGET DMA ABORT!\n");
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
                goto interrupt_exit;
        }
 
index d02df7d0c629cdf8198f01439e8b04d9a2e0d601..1b8715bfe26470c463bcac91a8bc1e77f02b7785 100644 (file)
@@ -743,14 +743,14 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
        status = inw(dev->iobase + PCI171x_STATUS);
        if (status & Status_FE) {
                dev_dbg(dev->class_dev, "A/D FIFO empty (%4x)\n", status);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
        if (status & Status_FF) {
                dev_dbg(dev->class_dev,
                        "A/D FIFO Full status (Fatal Error!) (%4x)\n", status);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
@@ -761,7 +761,7 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
                val = inw(dev->iobase + PCI171x_AD_DATA);
                ret = pci171x_ai_dropout(dev, s, s->async->cur_chan, val);
                if (ret) {
-                       s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       s->async->events |= COMEDI_CB_ERROR;
                        break;
                }
 
@@ -795,7 +795,7 @@ static int move_block_from_fifo(struct comedi_device *dev,
 
                ret = pci171x_ai_dropout(dev, s, s->async->cur_chan, val);
                if (ret) {
-                       s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       s->async->events |= COMEDI_CB_ERROR;
                        return ret;
                }
 
@@ -816,14 +816,14 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
        m = inw(dev->iobase + PCI171x_STATUS);
        if (!(m & Status_FH)) {
                dev_dbg(dev->class_dev, "A/D FIFO not half full! (%4x)\n", m);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
        if (m & Status_FF) {
                dev_dbg(dev->class_dev,
                        "A/D FIFO Full status (Fatal Error!) (%4x)\n", m);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
index 669b1703eb990dec65671b325bd01ec7169d9f6d..dd0c65a5b5a0a22e29098a877b0776c21f814b86 100644 (file)
@@ -1355,7 +1355,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
                outw(devpriv->adc_fifo_bits | LADFUL,
                     devpriv->control_status + INT_ADCFIFO);
                spin_unlock_irqrestore(&dev->spinlock, flags);
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
 
        comedi_handle_events(dev, s);
index 569310a9135be30c1238a121ea2ebd5c6f7464aa..5b43e4e6d037793ca295d05c2420e8bf3c64857b 100644 (file)
@@ -2804,7 +2804,7 @@ static void handle_ai_interrupt(struct comedi_device *dev,
        /*  check for fifo overrun */
        if (status & ADC_OVERRUN_BIT) {
                dev_err(dev->class_dev, "fifo overrun\n");
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
        /*  spin lock makes sure no one else changes plx dma control reg */
        spin_lock_irqsave(&dev->spinlock, flags);
index 80f41b7e8273540eb979e43b28e92a74ff8664fa..3666a68979fb65379b894b89a5d834141c77e9d0 100644 (file)
@@ -455,7 +455,7 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
        /* this probably won't catch overruns since the card doesn't generate
         * overrun interrupts, but we might as well try */
        if (status & OVRUN) {
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
                dev_err(dev->class_dev, "fifo overflow\n");
        }
 
index 13ed31cebb7e0b136ff02ffa5e586e1ee074e0e8..0790a28828de79f3c5625d3739ff2972f669cca1 100644 (file)
@@ -611,7 +611,7 @@ static void das1800_ai_handler(struct comedi_device *dev)
                /*  clear OVF interrupt bit */
                outb(CLEAR_INTR_MASK & ~OVF, dev->iobase + DAS1800_STATUS);
                dev_err(dev->class_dev, "FIFO overflow\n");
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
index e5bdc2423445dd94e78ed6cf3d48a56069d2d094..ff7f4be3f31432c67a50510b883df360b2d06510 100644 (file)
@@ -511,7 +511,7 @@ static irqreturn_t das800_interrupt(int irq, void *d)
 
        if (fifo_overflow) {
                spin_unlock_irqrestore(&dev->spinlock, irq_flags);
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return IRQ_HANDLED;
        }
index 1d9a7a63e06f1765c29d5b0f8abcdebe5daa8387..0aa51980e32778e267eaf2d2c440c55465ac91f8 100644 (file)
@@ -355,7 +355,7 @@ static irqreturn_t dt3k_interrupt(int irq, void *d)
                dt3k_ai_empty_fifo(dev, s);
 
        if (status & (DT3000_ADSWERR | DT3000_ADHWERR))
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
 
        debug_n_ints++;
        if (debug_n_ints >= 10)
index 0979f536ed39b49085e5be2344d794b58803f741..deada9784b693bdef49dc36a631470c8172c34e3 100644 (file)
@@ -261,12 +261,12 @@ static irqreturn_t gsc_hpdi_interrupt(int irq, void *d)
 
        if (hpdi_board_status & RX_OVERRUN_BIT) {
                dev_err(dev->class_dev, "rx fifo overrun\n");
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
 
        if (hpdi_board_status & RX_UNDERRUN_BIT) {
                dev_err(dev->class_dev, "rx fifo underrun\n");
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
 
        if (devpriv->dio_count == 0)
index 915685c1c85cd990e8eb0aab3114a1db6c57e6ec..d120aa244cf9a303f8804015d481a8eaeff97de1 100644 (file)
@@ -1068,7 +1068,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
                                 ME4000_AI_CTRL_BIT_SC_IRQ);
                        outl(tmp, dev->iobase + ME4000_AI_CTRL_REG);
 
-                       s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                       s->async->events |= COMEDI_CB_ERROR;
 
                        dev_err(dev->class_dev, "FIFO overflow\n");
                } else if ((tmp & ME4000_AI_STATUS_BIT_FF_DATA)
@@ -1089,7 +1089,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
                                 ME4000_AI_CTRL_BIT_SC_IRQ);
                        outl(tmp, dev->iobase + ME4000_AI_CTRL_REG);
 
-                       s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                       s->async->events |= COMEDI_CB_ERROR;
 
                        dev_err(dev->class_dev, "Undefined FIFO state\n");
                }
index 250014805e0b302f2e5ab2969ae7f0da57eb3d27..a1ce0b0b8c41c340180990ca022b2442e3b07144 100644 (file)
@@ -175,12 +175,12 @@ static irqreturn_t a2150_interrupt(int irq, void *d)
                return IRQ_NONE;
 
        if (status & OVFL_BIT) {
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
        }
 
        if ((status & DMA_TC_BIT) == 0) {
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return IRQ_HANDLED;
        }
index eea7f940c1f30af0d0ca6e64eb80bddac4ca1602..8fb5c1f64c01ad879b24dc7b5a15ba9c003756a3 100644 (file)
@@ -823,7 +823,7 @@ static int labpc_drain_fifo(struct comedi_device *dev)
        }
        if (i == timeout) {
                dev_err(dev->class_dev, "ai timeout, fifo never empties\n");
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                return -1;
        }
 
@@ -875,7 +875,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
        if (devpriv->stat1 & STAT1_OVERRUN) {
                /* clear error interrupt */
                devpriv->write_byte(dev, 0x1, ADC_FIFO_CLEAR_REG);
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                dev_err(dev->class_dev, "overrun\n");
                return IRQ_HANDLED;
@@ -895,7 +895,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
        if (devpriv->stat1 & STAT1_OVERFLOW) {
                /*  clear error interrupt */
                devpriv->write_byte(dev, 0x1, ADC_FIFO_CLEAR_REG);
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                dev_err(dev->class_dev, "overflow\n");
                return IRQ_HANDLED;
index 11e70173712dd93b2266b4d18004b34b65e061be..b6ddc015dedf733e2903d5f4f59b0cd970e61d50 100644 (file)
@@ -1478,7 +1478,7 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
                dev_err(dev->class_dev,
                        "unknown mite interrupt (ai_mite_status=%08x)\n",
                        ai_mite_status);
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
                /* disable_irq(dev->irq); */
        }
 #endif
@@ -1491,8 +1491,7 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
                        /* we probably aren't even running a command now,
                         * so it's a good idea to be careful. */
                        if (comedi_is_subdevice_running(s)) {
-                               s->async->events |=
-                                   COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                               s->async->events |= COMEDI_CB_ERROR;
                                comedi_handle_events(dev, s);
                        }
                        return;
@@ -1579,7 +1578,7 @@ static void handle_b_interrupt(struct comedi_device *dev,
                dev_err(dev->class_dev,
                        "unknown mite interrupt (ao_mite_status=%08x)\n",
                        ao_mite_status);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
        }
 #endif
 
index db7e8aac67b530064c01742a5aacc8db639a8074..db399fe8c301049143009a602401e9a9f01916a7 100644 (file)
@@ -418,7 +418,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
                                 CHSR_DRQ1 | CHSR_MRDY)) {
                        dev_dbg(dev->class_dev,
                                "unknown mite interrupt, disabling IRQ\n");
-                       async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       async->events |= COMEDI_CB_ERROR;
                        disable_irq(dev->irq);
                }
        }
@@ -460,7 +460,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
                        break;
                } else if (flags & Waited) {
                        writeb(ClearWaited, dev->mmio + Group_1_First_Clear);
-                       async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       async->events |= COMEDI_CB_ERROR;
                        break;
                } else if (flags & PrimaryTC) {
                        writeb(ClearPrimaryTC,
index f76601aad785d2dd2af6ed5b296f05ae82f8da83..37cc5e45f10c4f78e6c19913aeab20f095f0c839 100644 (file)
@@ -797,7 +797,7 @@ static void pcl812_handle_eoc(struct comedi_device *dev,
 
        if (pcl812_ai_eoc(dev, s, NULL, 0)) {
                dev_dbg(dev->class_dev, "A/D cmd IRQ without DRDY!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
index ba2e1373f43d4fcfab1fd5ea549ce1f5e9eac7ec..6e5d8bfb1c6d010b5c182e652f0ccbe6bee0e5b5 100644 (file)
@@ -468,7 +468,7 @@ static bool pcl818_ai_dropout(struct comedi_device *dev,
                        (devpriv->dma) ? "DMA" :
                        (devpriv->usefifo) ? "FIFO" : "IRQ",
                        chan, expected_chan);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return true;
        }
        return false;
@@ -501,7 +501,7 @@ static void pcl818_handle_eoc(struct comedi_device *dev,
 
        if (pcl818_ai_eoc(dev, s, NULL, 0)) {
                dev_err(dev->class_dev, "A/D mode1/3 IRQ without DRDY!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
@@ -558,14 +558,14 @@ static void pcl818_handle_fifo(struct comedi_device *dev,
 
        if (status & 4) {
                dev_err(dev->class_dev, "A/D mode1/3 FIFO overflow!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
        if (status & 1) {
                dev_err(dev->class_dev,
                        "A/D mode1/3 FIFO interrupt without data!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
index 96098110b0b3628957e1ea9e75a7c58eb7dc656b..dd06734f2158e21cb8969897beae057720c67c7b 100644 (file)
@@ -210,8 +210,7 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                        unsigned short data;
 
                        if (status & DAQP_STATUS_DATA_LOST) {
-                               s->async->events |=
-                                   COMEDI_CB_EOA | COMEDI_CB_OVERFLOW;
+                               s->async->events |= COMEDI_CB_OVERFLOW;
                                dev_warn(dev->class_dev, "data lost\n");
                                break;
                        }
@@ -239,7 +238,7 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                if (loop_limit <= 0) {
                        dev_warn(dev->class_dev,
                                 "loop_limit reached in daqp_interrupt()\n");
-                       s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       s->async->events |= COMEDI_CB_ERROR;
                }
 
                comedi_handle_events(dev, s);
This page took 0.035277 seconds and 5 git commands to generate.