Skip to content

Commit 8a8d087

Browse files
bigguinessgregkh
authored andcommitted
staging: comedi: adv_pci1710: remove 'has_counter' boardinfo
All the boards supported by this driver have a 8254 counter. Channels 1 and 2 are used to create the cascaded 32-bit analog input pacer. Counter 0 is available for the user on all the boards except the PCI-1713. Remove the 'has_counter' boardinfo and use the 'is_pci1713' boardinfo to determine if the user counter subdevice needs to be allocated and initialized. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6fa60dd commit 8a8d087

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/staging/comedi/drivers/adv_pci1710.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ struct boardtype {
138138
unsigned int has_diff_ai:1;
139139
unsigned int has_ao:1;
140140
unsigned int has_di_do:1;
141-
unsigned int has_counter:1;
142141
};
143142

144143
static const struct boardtype boardtypes[] = {
@@ -151,7 +150,6 @@ static const struct boardtype boardtypes[] = {
151150
.has_diff_ai = 1,
152151
.has_ao = 1,
153152
.has_di_do = 1,
154-
.has_counter = 1,
155153
},
156154
[BOARD_PCI1710HG] = {
157155
.name = "pci1710hg",
@@ -162,7 +160,6 @@ static const struct boardtype boardtypes[] = {
162160
.has_diff_ai = 1,
163161
.has_ao = 1,
164162
.has_di_do = 1,
165-
.has_counter = 1,
166163
},
167164
[BOARD_PCI1711] = {
168165
.name = "pci1711",
@@ -171,7 +168,6 @@ static const struct boardtype boardtypes[] = {
171168
.rangecode_ai = range_codes_pci17x1,
172169
.has_ao = 1,
173170
.has_di_do = 1,
174-
.has_counter = 1,
175171
},
176172
[BOARD_PCI1713] = {
177173
.name = "pci1713",
@@ -791,7 +787,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
791787
n_subdevices++;
792788
if (board->has_di_do)
793789
n_subdevices += 2;
794-
if (board->has_counter)
790+
if (!board->is_pci1713) /* all other boards have a user counter */
795791
n_subdevices++;
796792

797793
ret = comedi_alloc_subdevices(dev, n_subdevices);
@@ -866,8 +862,8 @@ static int pci1710_auto_attach(struct comedi_device *dev,
866862
subdev++;
867863
}
868864

869-
/* Counter subdevice (8254) */
870-
if (board->has_counter) {
865+
if (!board->is_pci1713) {
866+
/* Counter subdevice (8254) */
871867
s = &dev->subdevices[subdev];
872868
comedi_8254_subdevice_init(s, dev->pacer);
873869

0 commit comments

Comments
 (0)