staging: comedi: adl_pci9118: remove 'valid' from private data
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 5 May 2014 16:35:40 +0000 (09:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 12:18:55 +0000 (21:18 +0900)
This member of the private data is set only used during the (*detach)
to check if the board can be reset. The pci9118_reset() function just
needs a valid dev->iobase. Use that instead.

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 dd1cd6be66eca41edb4ac55b817e5bebdec001a0..f60dc41756e2f70f5c1d0c82a6e49030be810ac3 100644 (file)
@@ -320,7 +320,6 @@ struct pci9118_private {
        unsigned char AdControlReg;     /* A/D control register */
        unsigned char IntControlReg;    /* Interrupt control register */
        unsigned char AdFunctionReg;    /* A/D function register */
-       char valid;                     /* driver is ok */
        char ai_neverending;            /* we do unlimited AI */
        unsigned int ai_do;             /* what do AI? 0=nothing, 1 to 4 mode */
        unsigned int ai_act_scan;       /* how many scans we finished */
@@ -2044,7 +2043,6 @@ static int pci9118_common_attach(struct comedi_device *dev, int disable_irq,
        s->range_table = &range_digital;
        s->insn_bits = pci9118_insn_bits_do;
 
-       devpriv->valid = 1;
        devpriv->ai_maskharderr = 0x10a;
                                        /* default measure crash condition */
        if (hw_err_mask)                /* disable some requested */
@@ -2121,7 +2119,7 @@ static void pci9118_detach(struct comedi_device *dev)
        struct pci9118_private *devpriv = dev->private;
 
        if (devpriv) {
-               if (devpriv->valid)
+               if (dev->iobase)
                        pci9118_reset(dev);
                if (dev->irq)
                        free_irq(dev->irq, dev);