Commit f2a63429 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:adc:ad799x avoid bouncing back and forth from iio_priv space.

Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 24cba406
...@@ -124,11 +124,11 @@ struct ad799x_platform_data { ...@@ -124,11 +124,11 @@ struct ad799x_platform_data {
int ad7997_8_set_scan_mode(struct ad799x_state *st, unsigned mask); int ad7997_8_set_scan_mode(struct ad799x_state *st, unsigned mask);
#ifdef CONFIG_AD799X_RING_BUFFER #ifdef CONFIG_AD799X_RING_BUFFER
int ad799x_single_channel_from_ring(struct ad799x_state *st, int channum); int ad799x_single_channel_from_ring(struct iio_dev *indio_dev, int channum);
int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev); int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev);
void ad799x_ring_cleanup(struct iio_dev *indio_dev); void ad799x_ring_cleanup(struct iio_dev *indio_dev);
#else /* CONFIG_AD799X_RING_BUFFER */ #else /* CONFIG_AD799X_RING_BUFFER */
int ad799x_single_channel_from_ring(struct ad799x_state *st, int channum) int ad799x_single_channel_from_ring(struct iio_dev *indio_dev, int channum)
{ {
return -EINVAL; return -EINVAL;
} }
......
...@@ -150,7 +150,7 @@ static int ad799x_read_raw(struct iio_dev *dev_info, ...@@ -150,7 +150,7 @@ static int ad799x_read_raw(struct iio_dev *dev_info,
case 0: case 0:
mutex_lock(&dev_info->mlock); mutex_lock(&dev_info->mlock);
if (iio_buffer_enabled(dev_info)) if (iio_buffer_enabled(dev_info))
ret = ad799x_single_channel_from_ring(st, ret = ad799x_single_channel_from_ring(dev_info,
chan->scan_index); chan->scan_index);
else else
ret = ad799x_scan_direct(st, chan->address); ret = ad799x_scan_direct(st, chan->address);
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#include "ad799x.h" #include "ad799x.h"
int ad799x_single_channel_from_ring(struct ad799x_state *st, int channum) int ad799x_single_channel_from_ring(struct iio_dev *indio_dev, int channum)
{ {
struct iio_buffer *ring = iio_priv_to_dev(st)->buffer; struct iio_buffer *ring = indio_dev->buffer;
int count = 0, ret; int count = 0, ret;
u16 *ring_data; u16 *ring_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment