Commit 274113fd authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: addi_apci_1032: cleanup i_APCI1032_Reset()

Move this function from hwdrv_apci1032.c.

Remove the unnecessary comment and rename the CamelCase function to
apci1032_reset().
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c0133ee1
......@@ -278,31 +278,3 @@ static void v_APCI1032_Interrupt(int irq, void *d)
outl(ui_Temp, dev->iobase + APCI1032_CTRL_REG);
return;
}
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1032_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
| Return Value : |
| |
+----------------------------------------------------------------------------+
*/
static int i_APCI1032_Reset(struct comedi_device *dev)
{
/* disable the interrupts */
outl(0x0, dev->iobase + APCI1032_CTRL_REG);
/* Reset the interrupt status register */
inl(dev->iobase + APCI1032_STATUS_REG);
/* Disable the and/or interrupt */
outl(0x0, dev->iobase + APCI1032_MODE1_REG);
outl(0x0, dev->iobase + APCI1032_MODE2_REG);
return 0;
}
......@@ -12,6 +12,19 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
return IRQ_RETVAL(1);
}
static int apci1032_reset(struct comedi_device *dev)
{
/* disable the interrupts */
outl(0x0, dev->iobase + APCI1032_CTRL_REG);
/* Reset the interrupt status register */
inl(dev->iobase + APCI1032_STATUS_REG);
/* Disable the and/or interrupt */
outl(0x0, dev->iobase + APCI1032_MODE1_REG);
outl(0x0, dev->iobase + APCI1032_MODE2_REG);
return 0;
}
static int apci1032_attach_pci(struct comedi_device *dev,
struct pci_dev *pcidev)
{
......@@ -80,7 +93,7 @@ static int apci1032_attach_pci(struct comedi_device *dev,
s = &dev->subdevices[6];
s->type = COMEDI_SUBD_UNUSED;
i_APCI1032_Reset(dev);
apci1032_reset(dev);
return 0;
}
......@@ -91,7 +104,7 @@ static void apci1032_detach(struct comedi_device *dev)
if (devpriv) {
if (dev->iobase)
i_APCI1032_Reset(dev);
apci1032_reset(dev);
if (dev->irq)
free_irq(dev->irq, dev);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment