[PATCH 18/46] staging: comedi: adl_pci9111: digital input/output subdevices are fixed

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

 



The digital input and output subdevices are the same for all boards
supported by this driver. Remove the defines just open-code the values
in the attach function.

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

diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c
index 08f7e67..349ca0e 100644
--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -103,8 +103,6 @@ TODO:
 #define PCI9111_HR_AI_RESOLUTION_2_CMP_BIT	0x8000
 
 #define PCI9111_AI_ACQUISITION_PERIOD_MIN_NS	10000
-#define PCI9111_DI_CHANNEL_NBR			16
-#define	PCI9111_DO_CHANNEL_NBR			16
 
 #define PCI9111_RANGE_SETTING_DELAY		10
 #define PCI9111_AI_INSTANT_READ_UDELAY_US	2
@@ -1236,20 +1234,20 @@ static int pci9111_attach(struct comedi_device *dev,
 	s->insn_read	= pci9111_ao_insn_read;
 
 	s = &dev->subdevices[2];
-	s->type = COMEDI_SUBD_DI;
-	s->subdev_flags = SDF_READABLE;
-	s->n_chan = PCI9111_DI_CHANNEL_NBR;
-	s->maxdata = 1;
-	s->range_table = &range_digital;
-	s->insn_bits = pci9111_di_insn_bits;
+	s->type		= COMEDI_SUBD_DI;
+	s->subdev_flags	= SDF_READABLE;
+	s->n_chan	= 16;
+	s->maxdata	= 1;
+	s->range_table	= &range_digital;
+	s->insn_bits	= pci9111_di_insn_bits;
 
 	s = &dev->subdevices[3];
-	s->type = COMEDI_SUBD_DO;
-	s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
-	s->n_chan = PCI9111_DO_CHANNEL_NBR;
-	s->maxdata = 1;
-	s->range_table = &range_digital;
-	s->insn_bits = pci9111_do_insn_bits;
+	s->type		= COMEDI_SUBD_DO;
+	s->subdev_flags	= SDF_READABLE | SDF_WRITABLE;
+	s->n_chan	= 16;
+	s->maxdata	= 1;
+	s->range_table	= &range_digital;
+	s->insn_bits	= pci9111_do_insn_bits;
 
 	dev_private->is_valid = 1;
 
-- 
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