[PATCH v2 13/37] staging: comedi: das1800: remove 'ao_n_chan' boardinfo

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

 



The "st-da" board types have 4 analog output channels. All other
board types, with analog outputs, only have 2 channels.

Remove the 'ao_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 962a414..1a9565e 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -229,7 +229,6 @@ struct das1800_board {
 	int ai_speed;		/* max conversion period in nanoseconds */
 	int qram_len;		/* length of card's channel / gain queue */
 	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[] = {
 		.ai_speed	= 6250,
 		.qram_len	= 256,
 		.ao_ability	= 0,
-		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1801,
 	},
 	[BOARD_DAS1701ST_DA] = {
@@ -253,7 +251,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.qram_len	= 256,
 		.ao_ability	= 1,
-		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1801,
 	},
 	[BOARD_DAS1702ST] = {
@@ -262,7 +259,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.qram_len	= 256,
 		.ao_ability	= 0,
-		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1702ST_DA] = {
@@ -271,7 +267,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.qram_len	= 256,
 		.ao_ability	= 1,
-		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1702HR] = {
@@ -280,7 +275,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 20000,
 		.qram_len	= 256,
 		.ao_ability	= 0,
-		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1702HR_DA] = {
@@ -289,7 +283,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 20000,
 		.qram_len	= 256,
 		.ao_ability	= 1,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1701AO] = {
@@ -298,7 +291,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.qram_len	= 256,
 		.ao_ability	= 2,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1801,
 	},
 	[BOARD_DAS1702AO] = {
@@ -307,7 +299,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.qram_len	= 256,
 		.ao_ability	= 2,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1801ST] = {
@@ -316,7 +307,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 256,
 		.ao_ability	= 0,
-		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1801,
 	},
 	[BOARD_DAS1801ST_DA] = {
@@ -325,7 +315,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 256,
 		.ao_ability	= 1,
-		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1801,
 	},
 	[BOARD_DAS1802ST] = {
@@ -334,7 +323,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 256,
 		.ao_ability	= 0,
-		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1802ST_DA] = {
@@ -343,7 +331,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 256,
 		.ao_ability	= 1,
-		.ao_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1802HR] = {
@@ -352,7 +339,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 10000,
 		.qram_len	= 256,
 		.ao_ability	= 0,
-		.ao_n_chan	= 0,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1802HR_DA] = {
@@ -361,7 +347,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 10000,
 		.qram_len	= 256,
 		.ao_ability	= 1,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1801HC] = {
@@ -370,7 +355,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 64,
 		.ao_ability	= 1,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1801,
 	},
 	[BOARD_DAS1802HC] = {
@@ -379,7 +363,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 64,
 		.ao_ability	= 1,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
 	},
 	[BOARD_DAS1801AO] = {
@@ -388,7 +371,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 256,
 		.ao_ability	= 2,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1801,
 	},
 	[BOARD_DAS1802AO] = {
@@ -397,7 +379,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.qram_len	= 256,
 		.ao_ability	= 2,
-		.ao_n_chan	= 2,
 		.range_ai	= &range_ai_das1802,
 	},
 };
@@ -1368,7 +1349,7 @@ static int das1800_attach(struct comedi_device *dev,
 	if (board->ao_ability == 1) {
 		s->type		= COMEDI_SUBD_AO;
 		s->subdev_flags	= SDF_WRITABLE;
-		s->n_chan	= board->ao_n_chan;
+		s->n_chan	= (board->id == DAS1800_ID_ST_DA) ? 4 : 2;
 		s->maxdata	= is_16bit ? 0xffff : 0x0fff;
 		s->range_table	= &range_bipolar10;
 		s->insn_write	= das1800_ao_insn_write;
-- 
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