mirror of
https://github.com/torvalds/linux.git
synced 2024-12-24 20:01:55 +00:00
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: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
78c32ed39e
commit
9380d5ed36
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user