diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-10-14 10:44:18 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-29 15:48:53 +0800 |
commit | 5b1ccca7276d49daa3546dabebc5cdbb63c8d21d (patch) | |
tree | 67578c9757bd7be4baa0120d76bb14f5259ade2b /drivers/staging/comedi/drivers/addi_apci_1500.c | |
parent | staging: comedi: addi_common.c: remove i_ADDI_Detach() (diff) | |
download | linux-dev-5b1ccca7276d49daa3546dabebc5cdbb63c8d21d.tar.xz linux-dev-5b1ccca7276d49daa3546dabebc5cdbb63c8d21d.zip |
staging: comedi: addi_common.c: remove i_ADDI_Reset()
The addi_apci_035 and addi_apci_1500 are the only drivers left that use
this function in addi_common.c. The function simply calls the 'reset'
function that is in the boardinfo of the driver. Both drivers use the
same 'reset' function for all boardnfo entries.
Remove the i_ADDI_Reset() function as well as the 'reset' boardinfo and
just call the 'reset' function directly.
The i_ADDI_Reset() is called by addi_auto_attach() in addi_common.c after
a sucessful attach. Modify the (*auto_attach) in the drivers to call the
'reset' function directly and remove it from addi_auto_attach().
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>
Diffstat (limited to 'drivers/staging/comedi/drivers/addi_apci_1500.c')
-rw-r--r-- | drivers/staging/comedi/drivers/addi_apci_1500.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c index 50a147fc38bf..d4b42618859e 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1500.c +++ b/drivers/staging/comedi/drivers/addi_apci_1500.c @@ -21,7 +21,6 @@ static const struct addi_board apci1500_boardtypes[] = { .i_DoMaxdata = 0xffff, .i_Timer = 1, .interrupt = apci1500_interrupt, - .reset = apci1500_reset, .di_config = apci1500_di_config, .di_read = apci1500_di_read, .di_write = apci1500_di_write, @@ -39,15 +38,23 @@ static const struct addi_board apci1500_boardtypes[] = { static int apci1500_auto_attach(struct comedi_device *dev, unsigned long context) { + int ret; + dev->board_ptr = &apci1500_boardtypes[0]; - return addi_auto_attach(dev, context); + ret = addi_auto_attach(dev, context); + if (ret) + return ret; + + apci1500_reset(dev); + + return 0; } static void apci1500_detach(struct comedi_device *dev) { if (dev->iobase) - i_ADDI_Reset(dev); + apci1500_reset(dev); comedi_pci_detach(dev); } |