From: H Hartley Sweeten Date: Fri, 8 Apr 2016 19:41:39 +0000 (-0700) Subject: staging: comedi: das1800: remove 'do_n_chan' boardinfo X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bc524200ed26d173c78be46e4753c6f7754dc84e;p=linux-beck.git staging: comedi: das1800: remove 'do_n_chan' boardinfo 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c index 43e621b8689c..6641f2ed3fe6 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;