This member of the private data is not needed. We can check if
dev->irq is none zero instead. Remove it.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/pcl818.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index cacdca0..3dac1dd 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -274,7 +274,6 @@ struct pcl818_private {
        unsigned char neverending_ai;   /*  if=1, then we do neverending record 
(you must use cancel()) */
        unsigned int ns_min;    /*  manimal allowed delay between samples (in 
us) for actual card */
        int i8253_osc_base;     /*  1/frequency of on board oscilator in ns */
-       int irq_free;           /*  1=have allocated IRQ */
        int irq_blocked;        /*  1=IRQ now uses any subdev */
        int irq_was_now_closed; /*  when IRQ finish, there's stored int818_mode 
for last interrupt */
        int ai_mode;            /*  who now uses IRQ - 1=AI1 int, 2=AI1 dma, 
3=AI3 int, 4AI3 dma */
@@ -701,8 +700,7 @@ static irqreturn_t interrupt_pcl818(int irq, void *d)
 
        outb(0, dev->iobase + PCL818_CLRINT);   /* clear INT request */
 
-       if ((!dev->irq) || (!devpriv->irq_free) || (!devpriv->irq_blocked)
-           || (!devpriv->ai_mode)) {
+       if (!dev->irq || !devpriv->irq_blocked || !devpriv->ai_mode) {
                comedi_error(dev, "bad IRQ!");
                return IRQ_NONE;
        }
@@ -1230,10 +1228,8 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
        if ((1 << it->options[1]) & board->IRQbits) {
                ret = request_irq(it->options[1], interrupt_pcl818, 0,
                                  dev->board_name, dev);
-               if (ret == 0) {
+               if (ret == 0)
                        dev->irq = it->options[1];
-                       devpriv->irq_free = 1;
-               }
        }
 
        devpriv->irq_blocked = 0;       /* number of subdevice which use IRQ */
@@ -1242,7 +1238,7 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
        /* grab our DMA */
        dma = 0;
        devpriv->dma = dma;
-       if (!devpriv->irq_free)
+       if (!dev->irq)
                goto no_dma;    /* if we haven't IRQ, we can't use DMA */
        if (board->DMAbits != 0) {      /* board support DMA */
                dma = it->options[2];
-- 
1.8.4.4

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to