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>
                        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