[PATCH v2 10/37] staging: comedi: das1800: remove 'do_n_chan' boardinfo

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

 



The "hc" type boards have 8 digtial outputs. All other board
types have 4.

Remove the 'do_n_chan' member of the boardinfo and use the
'id' member to determine the subdevice 'n_chan'.

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

diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
index 43e621b..6641f2e 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -228,7 +228,6 @@ struct das1800_board {
 	unsigned char id;
 	int ai_speed;		/* max conversion period in nanoseconds */
 	int qram_len;		/* length of card's channel / gain queue */
-	int do_n_chan;		/* number of digital output channels */
 	int ao_ability;		/* 0 == no analog out, 1 == basic analog out, 2 == waveform analog out */
 	int ao_n_chan;		/* number of analog out channels */
 	const struct comedi_lrange *range_ai;	/* available input ranges */
@@ -244,7 +243,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST,
 		.ai_speed	= 6250,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1801,
@@ -254,7 +252,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST_DA,
 		.ai_speed	= 6250,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1801,
@@ -264,7 +261,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST,
 		.ai_speed	= 6250,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
@@ -274,7 +270,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST_DA,
 		.ai_speed	= 6250,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
@@ -284,7 +279,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_HR,
 		.ai_speed	= 20000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
@@ -294,7 +288,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_HR_DA,
 		.ai_speed	= 20000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
@@ -304,7 +297,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_AO,
 		.ai_speed	= 6250,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1801,
@@ -314,7 +306,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_AO,
 		.ai_speed	= 6250,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
@@ -324,7 +315,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST,
 		.ai_speed	= 3000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1801,
@@ -334,7 +324,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST_DA,
 		.ai_speed	= 3000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1801,
@@ -344,7 +333,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST,
 		.ai_speed	= 3000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
@@ -354,7 +342,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_ST_DA,
 		.ai_speed	= 3000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
@@ -364,7 +351,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_HR,
 		.ai_speed	= 10000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
@@ -374,7 +360,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_HR_DA,
 		.ai_speed	= 10000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
@@ -384,7 +369,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_HC,
 		.ai_speed	= 3000,
 		.qram_len	= 64,
-		.do_n_chan	= 8,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1801,
@@ -394,7 +378,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_HC,
 		.ai_speed	= 3000,
 		.qram_len	= 64,
-		.do_n_chan	= 8,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
@@ -404,7 +387,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_AO,
 		.ai_speed	= 3000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1801,
@@ -414,7 +396,6 @@ static const struct das1800_board das1800_boards[] = {
 		.id		= DAS1800_ID_AO,
 		.ai_speed	= 3000,
 		.qram_len	= 256,
-		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
@@ -1401,7 +1382,7 @@ static int das1800_attach(struct comedi_device *dev,
 	s = &dev->subdevices[3];
 	s->type		= COMEDI_SUBD_DO;
 	s->subdev_flags	= SDF_WRITABLE;
-	s->n_chan	= board->do_n_chan;
+	s->n_chan	= (board->id == DAS1800_ID_HC) ? 8 : 4;
 	s->maxdata	= 1;
 	s->range_table	= &range_digital;
 	s->insn_bits	= das1800_do_insn_bits;
-- 
2.6.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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