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: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten 2012-11-05 14:39:12 -07:00 • committed by Greg Kroah-Hartman
commit 274113fd78
2 changed files with 15 additions and 30 deletions

View file

@ -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;
}

View file

@ -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);
}