Skip to content

Commit

Permalink
staging:iio:adc:ad7606 remove buffer access to data from sysfs read.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent 78c32ed commit 9380d5e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
1 change: 0 additions & 1 deletion drivers/staging/iio/adc/ad7606.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
2 changes: 1 addition & 1 deletion drivers/staging/iio/adc/ad7606_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
24 changes: 0 additions & 24 deletions drivers/staging/iio/adc/ad7606_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 9380d5e

Please sign in to comment.