diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-11-29 18:16:27 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-29 18:05:29 -0800 |
commit | 791c9792ff2d12a02f0ab1c47fd7f7a94828b05b (patch) | |
tree | 1bdc45796b6a525f2bea4da802f2ec4a462412f0 /drivers/staging | |
parent | 6f92e11a24f413032495953f99cabcd57c53eacc (diff) |
staging: comedi: addi_apci_2032: absorb i_APCI2032_Reset()
This is the only 'reset' function used by the driver, remove it
from the boardinfo and absorb the code from hwdrv_apci2032.c into
the driver.
Rename the CamelCase function i_ADDI_Reset() to apci2032_reset().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c | 29 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/addi_apci_2032.c | 17 |
2 files changed, 11 insertions, 35 deletions
diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c index 8422b682ad9d..2332871f0719 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c @@ -369,32 +369,3 @@ static int i_APCI2032_ReadInterruptStatus(struct comedi_device *dev, *data = ui_Type; return insn->n; } - -/* -+----------------------------------------------------------------------------+ -| Function Name : int i_APCI2032_Reset(struct comedi_device *dev) | -| | -+----------------------------------------------------------------------------+ -| Task :Resets the registers of the card | -+----------------------------------------------------------------------------+ -| Input Parameters : | -+----------------------------------------------------------------------------+ -| Output Parameters : -- | -+----------------------------------------------------------------------------+ -| Return Value : | -| | -+----------------------------------------------------------------------------+ -*/ - -static int i_APCI2032_Reset(struct comedi_device *dev) -{ - struct addi_private *devpriv = dev->private; - - devpriv->b_DigitalOutputRegister = 0; - ui_Type = 0; - outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP); /* Resets the output channels */ - outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); /* Disables the interrupt. */ - outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */ - outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE); /* reload=0 */ - return 0; -} diff --git a/drivers/staging/comedi/drivers/addi_apci_2032.c b/drivers/staging/comedi/drivers/addi_apci_2032.c index bd79c28e385c..5e2cf0dec8cb 100644 --- a/drivers/staging/comedi/drivers/addi_apci_2032.c +++ b/drivers/staging/comedi/drivers/addi_apci_2032.c @@ -18,7 +18,6 @@ static const struct addi_board apci2032_boardtypes[] = { .i_DoMaxdata = 0xffffffff, .i_Timer = 1, .interrupt = v_APCI2032_Interrupt, - .reset = i_APCI2032_Reset, .do_config = i_APCI2032_ConfigDigitalOutput, .do_bits = apci2032_do_insn_bits, .do_read = i_APCI2032_ReadInterruptStatus, @@ -37,11 +36,17 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d) return IRQ_RETVAL(1); } -static int i_ADDI_Reset(struct comedi_device *dev) +static int apci2032_reset(struct comedi_device *dev) { - const struct addi_board *this_board = comedi_board(dev); + struct addi_private *devpriv = dev->private; + + devpriv->b_DigitalOutputRegister = 0; + ui_Type = 0; + outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP); + outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); + outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); + outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE); - this_board->reset(dev); return 0; } @@ -195,7 +200,7 @@ static int apci2032_auto_attach(struct comedi_device *dev, s = &dev->subdevices[6]; s->type = COMEDI_SUBD_UNUSED; - i_ADDI_Reset(dev); + apci2032_reset(dev); return 0; } @@ -206,7 +211,7 @@ static void apci2032_detach(struct comedi_device *dev) if (devpriv) { if (dev->iobase) - i_ADDI_Reset(dev); + apci2032_reset(dev); if (dev->irq) free_irq(dev->irq, dev); if (devpriv->dw_AiBase) |