]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: comedi: das1800: remove 'ao_n_chan' boardinfo
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 8 Apr 2016 19:41:42 +0000 (12:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 05:16:10 +0000 (22:16 -0700)
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@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/das1800.c

index 962a414e0544a3b40db4a20fd8b1fa0253da6324..1a9565ead83e6ce6539ee49a5d96a93f2a0287ae 100644 (file)
@@ -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;