Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90ad57be authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f229594a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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