[PATCH 06/35] staging: comedi: das1800: remove 'common' boardinfo member

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

 



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

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

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 | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
index 1b0eb6f..69680ea 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -205,7 +205,6 @@ struct das1800_board {
 	const char *name;
 	int ai_speed;		/* max conversion period in nanoseconds */
 	int resolution;		/* bits of ai resolution */
-	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 */
@@ -222,14 +221,12 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1701st",
 		.ai_speed	= 6250,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.range_ai	= &range_ai_das1801,
 	}, {
 		.name		= "das-1701st-da",
 		.ai_speed	= 6250,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -238,14 +235,12 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1702st",
 		.ai_speed	= 6250,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
 	}, {
 		.name		= "das-1702st-da",
 		.ai_speed	= 6250,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -254,14 +249,12 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1702hr",
 		.ai_speed	= 20000,
 		.resolution	= 16,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
 	}, {
 		.name		= "das-1702hr-da",
 		.ai_speed	= 20000,
 		.resolution	= 16,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
@@ -270,7 +263,6 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1701ao",
 		.ai_speed	= 6250,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -279,7 +271,6 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1702ao",
 		.ai_speed	= 6250,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -288,14 +279,12 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1801st",
 		.ai_speed	= 3000,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.range_ai	= &range_ai_das1801,
 	}, {
 		.name		= "das-1801st-da",
 		.ai_speed	= 3000,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -304,14 +293,12 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1802st",
 		.ai_speed	= 3000,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
 	}, {
 		.name		= "das-1802st-da",
 		.ai_speed	= 3000,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 4,
@@ -320,14 +307,12 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1802hr",
 		.ai_speed	= 10000,
 		.resolution	= 16,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.range_ai	= &range_ai_das1802,
 	}, {
 		.name		= "das-1802hr-da",
 		.ai_speed	= 10000,
 		.resolution	= 16,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 1,
 		.ao_n_chan	= 2,
@@ -354,7 +339,6 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1801ao",
 		.ai_speed	= 3000,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -363,7 +347,6 @@ static const struct das1800_board das1800_boards[] = {
 		.name		= "das-1802ao",
 		.ai_speed	= 3000,
 		.resolution	= 12,
-		.common		= 1,
 		.do_n_chan	= 4,
 		.ao_ability	= 2,
 		.ao_n_chan	= 2,
@@ -1305,7 +1288,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->has_64_ai_chan)
 		s->subdev_flags	|= SDF_COMMON;
 	s->n_chan	= (board->has_64_ai_chan) ? 64 : 16;
 	s->maxdata	= (1 << board->resolution) - 1;
-- 
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