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

staging:iio:adc:ad7606 remove buffer access to data from sysfs read.

No known use case and complicates in kernel interface work.
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 78c32ed3
......@@ -99,7 +99,6 @@ enum ad7606_supported_device_ids {
ID_AD7606_4
};
int ad7606_scan_from_ring(struct iio_dev *indio_dev, unsigned ch);
int ad7606_register_ring_funcs_and_init(struct iio_dev *indio_dev);
void ad7606_ring_cleanup(struct iio_dev *indio_dev);
#endif /* IIO_ADC_AD7606_H_ */
......@@ -91,7 +91,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev,
case 0:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = ad7606_scan_from_ring(indio_dev, chan->address);
ret = -EBUSY;
else
ret = ad7606_scan_direct(indio_dev, chan->address);
mutex_unlock(&indio_dev->mlock);
......
......@@ -18,30 +18,6 @@
#include "ad7606.h"
int ad7606_scan_from_ring(struct iio_dev *indio_dev, unsigned ch)
{
struct iio_buffer *ring = indio_dev->buffer;
int ret;
u16 *ring_data;
ring_data = kmalloc(ring->access->get_bytes_per_datum(ring),
GFP_KERNEL);
if (ring_data == NULL) {
ret = -ENOMEM;
goto error_ret;
}
ret = ring->access->read_last(ring, (u8 *) ring_data);
if (ret)
goto error_free_ring_data;
ret = ring_data[ch];
error_free_ring_data:
kfree(ring_data);
error_ret:
return ret;
}
/**
* ad7606_trigger_handler_th() th/bh of trigger launched polling to ring buffer
*
......
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