staging:iio:adc:ad799x avoid bouncing back and forth from iio_priv space.
authorJonathan Cameron <jic23@cam.ac.uk>
Fri, 30 Sep 2011 09:05:34 +0000 (10:05 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 23:07:02 +0000 (16:07 -0700)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/adc/ad799x.h
drivers/staging/iio/adc/ad799x_core.c
drivers/staging/iio/adc/ad799x_ring.c

index 98f06f682b8e4418793b7c8f35a351769d7db0e8..eda01d5bab7ded7b6a11aa741622da29c0f09acc 100644 (file)
@@ -124,11 +124,11 @@ struct ad799x_platform_data {
 int ad7997_8_set_scan_mode(struct ad799x_state *st, unsigned mask);
 
 #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);
 void ad799x_ring_cleanup(struct iio_dev *indio_dev);
 #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;
 }
index ff902ea6dbb0ef533d951a93a9fd2f80a9212e66..dd279ced6c7b1bc76b1e65af4d26b1b999fc88b2 100644 (file)
@@ -150,7 +150,7 @@ static int ad799x_read_raw(struct iio_dev *dev_info,
        case 0:
                mutex_lock(&dev_info->mlock);
                if (iio_buffer_enabled(dev_info))
-                       ret = ad799x_single_channel_from_ring(st,
+                       ret = ad799x_single_channel_from_ring(dev_info,
                                                              chan->scan_index);
                else
                        ret = ad799x_scan_direct(st, chan->address);
index 1bcc168fa76b98cdb75b2353bd03080feb7dcf08..e3f4698d7815a5361b729e11ddc79875a1d53618 100644 (file)
@@ -23,9 +23,9 @@
 
 #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;
        u16 *ring_data;