[PATCH v2 07/37] staging: comedi: das1800: remove 'common' boardinfo member

H Hartley Sweeten hsweeten at visionengravers.com
Fri Apr 8 19:41:36 UTC 2016


The "hc" type boards do not support common mode analog inputs
all the other board types do.

Remove the unnecessary member from the boardinfo and use the
'id' member to determine if the SDF_COMMON flag should be set
for the subdevice.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 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 e24d0c9..6795f3e 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 resolution;		/* bits of ai resolution */
 	int qram_len;		/* length of card's channel / gain queue */
-	int common;		/* supports AREF_COMMON flag */
 	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 */
@@ -247,7 +246,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
@@ -259,7 +257,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -271,7 +268,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
@@ -283,7 +279,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -295,7 +290,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 20000,
 		.resolution	= 16,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
@@ -307,7 +301,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 20000,
 		.resolution	= 16,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
@@ -319,7 +312,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -331,7 +323,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 6250,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -343,7 +334,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
@@ -355,7 +345,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -367,7 +356,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
@@ -379,7 +367,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -391,7 +378,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 10000,
 		.resolution	= 16,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 0,
 		.ao_n_chan	= 0,
@@ -403,7 +389,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 10000,
 		.resolution	= 16,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
@@ -415,7 +400,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 64,
-		.common		= 0,
 		.do_n_chan	= 8,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
@@ -427,7 +411,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 64,
-		.common		= 0,
 		.do_n_chan	= 8,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
@@ -439,7 +422,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -451,7 +433,6 @@ static const struct das1800_board das1800_boards[] = {
 		.ai_speed	= 3000,
 		.resolution	= 12,
 		.qram_len	= 256,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -1394,7 +1375,7 @@ static int das1800_attach(struct comedi_device *dev,
 	s = &dev->subdevices[0];
 	s->type		= COMEDI_SUBD_AI;
 	s->subdev_flags	= SDF_READABLE | SDF_DIFF | SDF_GROUND;
-	if (board->common)
+	if (board->id != DAS1800_ID_HC)
 		s->subdev_flags	|= SDF_COMMON;
 	s->n_chan	= board->qram_len;
 	s->maxdata	= (1 << board->resolution) - 1;
-- 
2.6.3



More information about the devel mailing list