staging: comedi: icp_multi: remove 'valid' member from private data
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 26 Aug 2014 00:55:50 +0000 (17:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Aug 2014 20:25:51 +0000 (13:25 -0700)
This member is set at the end of the driver attach and is only used to
verify that icp_multi_reset() can be called in the (*detach). The only
requirement for icp_multi_reset() to work is that the dev->mmio is valid.

Remove the 'valid' member from the private data and use 'dev->mmio' to
see if the reset can be done.

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

index fedc62e1e23c6938efe51112fcfad718e8091c87..f4e1c1cf4178ff2ffc5ef397981fe12a249046ea 100644 (file)
@@ -107,7 +107,6 @@ static const char range_codes_analog[] = { 0x00, 0x20, 0x10, 0x30 };
 */
 
 struct icp_multi_private {
-       char valid;             /*  card is usable */
        unsigned int AdcCmdStatus;      /*  ADC Command/Status register */
        unsigned int DacCmdStatus;      /*  DAC Command/Status register */
        unsigned int IntEnable; /*  Interrupt Enable register */
@@ -530,18 +529,13 @@ static int icp_multi_auto_attach(struct comedi_device *dev,
        s->insn_read = icp_multi_insn_read_ctr;
        s->insn_write = icp_multi_insn_write_ctr;
 
-       devpriv->valid = 1;
-
        return 0;
 }
 
 static void icp_multi_detach(struct comedi_device *dev)
 {
-       struct icp_multi_private *devpriv = dev->private;
-
-       if (devpriv)
-               if (devpriv->valid)
-                       icp_multi_reset(dev);
+       if (dev->mmio)
+               icp_multi_reset(dev);
        comedi_pci_detach(dev);
 }