[PATCH 15/41] staging: comedi: addi_apci_1516: cleanup subdevice ops pointers

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

 



The same subdevice operations are used, as needed, for all the boards
supported by this driver. Remove the function pointers from the
boardinfo and set the subdevice operations directly in the attach.

Remove all the subdevice operations that would be set to NULL.

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_1516.c | 30 +++++--------------------
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1516.c b/drivers/staging/comedi/drivers/addi_apci_1516.c
index d78174af..8fc848b 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1516.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1516.c
@@ -16,7 +16,6 @@ static const struct addi_board apci1516_boardtypes[] = {
 		.i_PCIEeprom		= ADDIDATA_EEPROM,
 		.pc_EepromChip		= ADDIDATA_S5920,
 		.i_NbrDiChannel		= 16,
-		.di_bits		= apci1516_di_insn_bits,
 	}, {
 		.pc_DriverName		= "apci1516",
 		.i_VendorId		= PCI_VENDOR_ID_ADDIDATA,
@@ -29,11 +28,6 @@ static const struct addi_board apci1516_boardtypes[] = {
 		.i_NbrDiChannel		= 8,
 		.i_NbrDoChannel		= 8,
 		.i_Timer		= 1,
-		.di_bits		= apci1516_di_insn_bits,
-		.do_bits		= apci1516_do_insn_bits,
-		.timer_config		= i_APCI1516_ConfigWatchdog,
-		.timer_write		= i_APCI1516_StartStopWriteWatchdog,
-		.timer_read		= i_APCI1516_ReadWatchdog,
 	}, {
 		.pc_DriverName		= "apci2016",
 		.i_VendorId		= PCI_VENDOR_ID_ADDIDATA,
@@ -45,10 +39,6 @@ static const struct addi_board apci1516_boardtypes[] = {
 		.pc_EepromChip		= ADDIDATA_S5920,
 		.i_NbrDoChannel		= 16,
 		.i_Timer		= 1,
-		.do_bits		= apci1516_do_insn_bits,
-		.timer_config		= i_APCI1516_ConfigWatchdog,
-		.timer_write		= i_APCI1516_StartStopWriteWatchdog,
-		.timer_read		= i_APCI1516_ReadWatchdog,
 	},
 };
 
@@ -168,10 +158,7 @@ static int __devinit apci1516_auto_attach(struct comedi_device *dev,
 			devpriv->s_EeParameters.i_NbrDiChannel;
 		s->range_table = &range_digital;
 		s->io_bits = 0;	/* all bits input */
-		s->insn_config = this_board->di_config;
-		s->insn_read = this_board->di_read;
-		s->insn_write = this_board->di_write;
-		s->insn_bits = this_board->di_bits;
+		s->insn_bits = apci1516_di_insn_bits;
 	} else {
 		s->type = COMEDI_SUBD_UNUSED;
 	}
@@ -187,12 +174,7 @@ static int __devinit apci1516_auto_attach(struct comedi_device *dev,
 			devpriv->s_EeParameters.i_NbrDoChannel;
 		s->range_table = &range_digital;
 		s->io_bits = 0xf;	/* all bits output */
-
-		/* insn_config - for digital output memory */
-		s->insn_config = this_board->do_config;
-		s->insn_write = this_board->do_write;
-		s->insn_bits = this_board->do_bits;
-		s->insn_read = this_board->do_read;
+		s->insn_bits = apci1516_do_insn_bits;
 	} else {
 		s->type = COMEDI_SUBD_UNUSED;
 	}
@@ -206,11 +188,9 @@ static int __devinit apci1516_auto_attach(struct comedi_device *dev,
 		s->maxdata = 0;
 		s->len_chanlist = 1;
 		s->range_table = &range_digital;
-
-		s->insn_write = this_board->timer_write;
-		s->insn_read = this_board->timer_read;
-		s->insn_config = this_board->timer_config;
-		s->insn_bits = this_board->timer_bits;
+		s->insn_write = i_APCI1516_StartStopWriteWatchdog;
+		s->insn_read = i_APCI1516_ReadWatchdog;
+		s->insn_config = i_APCI1516_ConfigWatchdog;
 	} 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