staging: comedi: addi_apci_3120: tidy up apci3120_reset()

This function is only called during the attach of the driver and it's
called after the private data has been kzalloc'd. There is no reason
to clear any of the private data members.

Simplify the function by just writing '0' to the necessary registers
to disable all the interrupt sources and stop the timers.

For aesthetics, change the return type to void.

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>
This commit is contained in:
H Hartley Sweeten 2014-11-04 10:55:06 -07:00 committed by Greg Kroah-Hartman
parent 994211b6ff
commit 884218c5a3

View File

@ -72,25 +72,16 @@ static void apci3120_addon_write(struct comedi_device *dev,
outw((val >> 16) & 0xffff, devpriv->addon + APCI3120_ADDON_DATA_REG);
}
static int apci3120_reset(struct comedi_device *dev)
static void apci3120_reset(struct comedi_device *dev)
{
struct apci3120_private *devpriv = dev->private;
/* variables used in timer subdevice */
devpriv->b_Timer2Mode = 0;
devpriv->b_Timer2Interrupt = 0;
/* Disable all interrupts, watchdog for the anolog output */
devpriv->mode = 0;
outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG);
/* disable all interrupt sources */
outb(0, dev->iobase + APCI3120_MODE_REG);
/* disable all counters, ext trigger, and reset scan */
devpriv->ctrl = 0;
outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG);
outw(0, dev->iobase + APCI3120_CTRL_REG);
/* clear interrupt status */
inw(dev->iobase + APCI3120_STATUS_REG);
return 0;
}
static int apci3120_cancel(struct comedi_device *dev,