From: Jonathan Cameron Date: Mon, 5 Dec 2011 22:18:22 +0000 (+0000) Subject: staging:iio:adc:ad7993 stop reading from buffer for sysfs raw read. X-Git-Tag: next-20111209~13^2~56 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=950935b17c67ddfedfc5cf917de3da7294307874;p=karo-tx-linux.git staging:iio:adc:ad7993 stop reading from buffer for sysfs raw read. No known usecase and makes in kernel interface work more complex. Signed-off-by: Jonathan Cameron Acked-by: Lars-Peter Clausen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c index b2dedb2dfc2e..4047c5d205e1 100644 --- a/drivers/staging/iio/adc/ad7793.c +++ b/drivers/staging/iio/adc/ad7793.c @@ -316,25 +316,6 @@ out: return ret; } -static int ad7793_scan_from_ring(struct ad7793_state *st, unsigned ch, int *val) -{ - struct iio_buffer *ring = iio_priv_to_dev(st)->buffer; - int ret; - s64 dat64[2]; - u32 *dat32 = (u32 *)dat64; - - if (!(test_bit(ch, ring->scan_mask))) - return -EBUSY; - - ret = ring->access->read_last(ring, (u8 *) &dat64); - if (ret) - return ret; - - *val = *dat32; - - return 0; -} - static int ad7793_ring_preenable(struct iio_dev *indio_dev) { struct ad7793_state *st = iio_priv(indio_dev); @@ -650,8 +631,7 @@ static int ad7793_read_raw(struct iio_dev *indio_dev, case 0: mutex_lock(&indio_dev->mlock); if (iio_buffer_enabled(indio_dev)) - ret = ad7793_scan_from_ring(st, - chan->scan_index, &smpl); + ret = -EBUSY; else ret = ad7793_read(st, chan->address, chan->scan_type.realbits / 8, &smpl);