linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: iio_buffer_register: Use correct channel when calculating masklength
@ 2012-07-02 12:52 Lars-Peter Clausen
  2012-07-03 17:36 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2012-07-02 12:52 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen

The channel set assigned to the iio device is not necessarily the same has the
channel set passed to iio_buffer_register. So to avoid possible complications
always work with the channel set pass to iio_buffer_register and ignore the
channel set assigned to the iio device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/industrialio-buffer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index bb88377..d074051 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -292,7 +292,7 @@ int iio_buffer_register(struct iio_dev *indio_dev,
 			if (channels[i].scan_index >
 			    (int)indio_dev->masklength - 1)
 				indio_dev->masklength
-					= indio_dev->channels[i].scan_index + 1;
+					= channels[i].scan_index + 1;
 
 			ret = iio_buffer_add_channel_sysfs(indio_dev,
 							 &channels[i]);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: iio_buffer_register: Use correct channel when calculating masklength
  2012-07-02 12:52 [PATCH] iio: iio_buffer_register: Use correct channel when calculating masklength Lars-Peter Clausen
@ 2012-07-03 17:36 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2012-07-03 17:36 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Jonathan Cameron, linux-iio

On 07/02/2012 01:52 PM, Lars-Peter Clausen wrote:
> The channel set assigned to the iio device is not necessarily the same has the
> channel set passed to iio_buffer_register. So to avoid possible complications
> always work with the channel set pass to iio_buffer_register and ignore the
> channel set assigned to the iio device.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
merged to fixes. Thanks
> ---
>  drivers/iio/industrialio-buffer.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index bb88377..d074051 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -292,7 +292,7 @@ int iio_buffer_register(struct iio_dev *indio_dev,
>  			if (channels[i].scan_index >
>  			    (int)indio_dev->masklength - 1)
>  				indio_dev->masklength
> -					= indio_dev->channels[i].scan_index + 1;
> +					= channels[i].scan_index + 1;
>  
>  			ret = iio_buffer_add_channel_sysfs(indio_dev,
>  							 &channels[i]);
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-03 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-02 12:52 [PATCH] iio: iio_buffer_register: Use correct channel when calculating masklength Lars-Peter Clausen
2012-07-03 17:36 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).