diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2016-03-22 11:10:46 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-28 07:30:36 -0700 |
commit | 90ad57be6be10e7084ca677d6eddfba612b55a62 (patch) | |
tree | f449586af0590b3ecc51460e8a5919c473369e9b /drivers/staging/comedi/drivers/ni_660x.c | |
parent | f229594a327720c0761e7307a5472aea780268c3 (diff) |
staging: comedi: ni_660x: initialize the counter with the subdevice init
Remove the extra for loop and just initialize the counter as the subdevices
are created.
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>
Diffstat (limited to 'drivers/staging/comedi/drivers/ni_660x.c')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_660x.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 636630380100..5969723b6167 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -1021,14 +1021,13 @@ static int ni_660x_auto_attach(struct comedi_device *dev, s->buf_change = ni_660x_buf_change; s->async_dma_dir = DMA_BIDIRECTIONAL; s->private = counter; + + ni_tio_init_counter(counter); } else { s->type = COMEDI_SUBD_UNUSED; } } - for (i = 0; i < n_counters; ++i) - ni_tio_init_counter(&gpct_dev->counters[i]); - /* * Default the DIO channels as: * chan 0-7: DIO inputs |