Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281263
b: refs/heads/master
c: 790d875
h: refs/heads/master
i:
  281261: 491416e
  281259: bfd8076
  281255: 59fdb67
  281247: 1108741
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent d8cfb35 commit 0e96154
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 41 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 950935b17c67ddfedfc5cf917de3da7294307874
refs/heads/master: 790d875989845b4b2b82f17d24afc7ac396fce62
5 changes: 0 additions & 5 deletions trunk/drivers/staging/iio/adc/ad7887.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,9 @@ enum ad7887_supported_device_ids {
};

#ifdef CONFIG_IIO_BUFFER
int ad7887_scan_from_ring(struct ad7887_state *st, int channum);
int ad7887_register_ring_funcs_and_init(struct iio_dev *indio_dev);
void ad7887_ring_cleanup(struct iio_dev *indio_dev);
#else /* CONFIG_IIO_BUFFER */
static inline int ad7887_scan_from_ring(struct ad7887_state *st, int channum)
{
return 0;
}

static inline int
ad7887_register_ring_funcs_and_init(struct iio_dev *indio_dev)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/iio/adc/ad7887_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static int ad7887_read_raw(struct iio_dev *indio_dev,
case 0:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = ad7887_scan_from_ring(st, 1 << chan->address);
ret = -EBUSY;
else
ret = ad7887_scan_direct(st, chan->address);
mutex_unlock(&indio_dev->mlock);
Expand Down
34 changes: 0 additions & 34 deletions trunk/drivers/staging/iio/adc/ad7887_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,6 @@

#include "ad7887.h"

int ad7887_scan_from_ring(struct ad7887_state *st, int channum)
{
struct iio_buffer *ring = iio_priv_to_dev(st)->buffer;
int count = 0, ret;
u16 *ring_data;

if (!(test_bit(channum, ring->scan_mask))) {
ret = -EBUSY;
goto error_ret;
}

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;

/* for single channel scan the result is stored with zero offset */
if ((test_bit(1, ring->scan_mask) || test_bit(0, ring->scan_mask)) &&
(channum == 1))
count = 1;

ret = be16_to_cpu(ring_data[count]);

error_free_ring_data:
kfree(ring_data);
error_ret:
return ret;
}

/**
* ad7887_ring_preenable() setup the parameters of the ring before enabling
*
Expand Down

0 comments on commit 0e96154

Please sign in to comment.