Re: iio_buffer_register arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 5 2012, Lars-Peter Clausen wrote:

On 01/04/2012 01:30 PM, Manuel Stahl wrote:
Hi,

I have a short question about the arguments of iio_buffer_register. Are they really needed?
When we look at this code from lis3l02dq_core.c:

	indio_dev->channels = lis3l02dq_channels;
	indio_dev->num_channels = ARRAY_SIZE(lis3l02dq_channels);

	<zip>

	ret = iio_buffer_register(indio_dev,
				  lis3l02dq_channels,
				  ARRAY_SIZE(lis3l02dq_channels));

The needed info is already available in indio_dev...


It might even cause problems if we pass another set of channels to
iio_buffer_register as we assign to the indio_dev. So it properly is a good
idea to update the function to only take the indio_dev as a parameter.
There certainly have been driver that have different sets of channels passed into
the buffer registration code from elsewhere. These mostly came about
to keep things working with minimal changes as we moved over the channel spec.

Also, we may need a clean way to say, 'this one does not go in the buffer' and
also a cleaner option for the opposite case of 'this one is buffered only'.

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux