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

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

staging: comedi: adl_pci9111: use comedi_buf_write_samples()



Use comedi_buf_write_samples() to add the samples to the async buffer.
The number of bytes to add is determined automatically based on the
number of samples and the bytes_per_sample().

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 be591d5c
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -477,9 +477,8 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev,
	     devpriv->ai_bounce_buffer, samples);

	if (devpriv->scan_delay < 1) {
		total = cfc_write_array_to_buffer(s,
						  devpriv->ai_bounce_buffer,
						  samples * sizeof(short));
		total = comedi_buf_write_samples(s, devpriv->ai_bounce_buffer,
						 samples);
	} else {
		unsigned int pos = 0;
		unsigned int to_read;
@@ -492,9 +491,9 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev,
				if (to_read > samples - pos)
					to_read = samples - pos;

				total += cfc_write_array_to_buffer(s,
				total += comedi_buf_write_samples(s,
						devpriv->ai_bounce_buffer + pos,
						to_read * sizeof(short));
						to_read);
			} else {
				to_read = devpriv->chunk_num_samples -
					  devpriv->chunk_counter;