[PATCH 24/27] staging: comedi: addi_apci_3120: clarify AO subdevice init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Only the apci3120 board supports an analog output subdevice. The
boardinfo indicates this by setting the 'i_NbrAoChannel' value.

The range table as well as the function used for the insn_write
operation are fixed for the analog outputs. Remove this information
from the boardinfo and use it directly in the subdevice init.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/addi_apci_3120.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c
index 9eb49ed..6ca3a3c 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3120.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3120.c
@@ -21,12 +21,10 @@ static const struct addi_board apci3120_boardtypes[] = {
 		.i_NbrAoChannel		= 8,
 		.i_AiMaxdata		= 0xffff,
 		.i_AoMaxdata		= 0x3fff,
-		.pr_AoRangelist		= &range_apci3120_ao,
 		.i_NbrDiChannel		= 4,
 		.i_NbrDoChannel		= 4,
 		.i_DoMaxdata		= 0x0f,
 		.interrupt		= v_APCI3120_Interrupt,
-		.ao_write		= i_APCI3120_InsnWriteAnalogOutput,
 	}, {
 		.pc_DriverName		= "apci3001",
 		.i_VendorId		= PCI_VENDOR_ID_ADDIDATA_OLD,
@@ -172,9 +170,8 @@ static int apci3120_attach_pci(struct comedi_device *dev,
 		s->n_chan = this_board->i_NbrAoChannel;
 		s->maxdata = this_board->i_AoMaxdata;
 		s->len_chanlist = this_board->i_NbrAoChannel;
-		s->range_table = this_board->pr_AoRangelist;
-		s->insn_config = this_board->ao_config;
-		s->insn_write = this_board->ao_write;
+		s->range_table = &range_apci3120_ao;
+		s->insn_write = i_APCI3120_InsnWriteAnalogOutput;
 	} else {
 		s->type = COMEDI_SUBD_UNUSED;
 	}
-- 
1.7.11

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux