Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281259
b: refs/heads/master
c: 389ac48
h: refs/heads/master
i:
  281257: ef80395
  281255: 59fdb67
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent 66d4876 commit bfd8076
Show file tree
Hide file tree
Showing 4 changed files with 3 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: e0f0ddad805e98ae725d52a6cc23ac114ecf6114
refs/heads/master: 389ac488330d9946a0f7dd572acd790e41486a9e
5 changes: 0 additions & 5 deletions trunk/drivers/staging/iio/adc/ad7298.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,9 @@ struct ad7298_state {
};

#ifdef CONFIG_IIO_BUFFER
int ad7298_scan_from_ring(struct iio_dev *indio_dev, long ch);
int ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev);
void ad7298_ring_cleanup(struct iio_dev *indio_dev);
#else /* CONFIG_IIO_BUFFER */
static inline int ad7298_scan_from_ring(struct iio_dev *indio_dev, long ch)
{
return 0;
}

static inline int
ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev)
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/staging/iio/adc/ad7298_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,8 @@ static int ad7298_read_raw(struct iio_dev *indio_dev,
switch (m) {
case 0:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) {
if (chan->address == AD7298_CH_TEMP)
ret = -ENODEV;
else
ret = ad7298_scan_from_ring(indio_dev,
chan->address);
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
ret = -EBUSY;
} else {
if (chan->address == AD7298_CH_TEMP)
ret = ad7298_scan_temp(st, val);
Expand Down
29 changes: 0 additions & 29 deletions trunk/drivers/staging/iio/adc/ad7298_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,6 @@

#include "ad7298.h"

int ad7298_scan_from_ring(struct iio_dev *indio_dev, long ch)
{
struct iio_buffer *ring = indio_dev->buffer;
int ret;
u16 *ring_data;

if (!(test_bit(ch, 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;

ret = be16_to_cpu(ring_data[ch]);

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

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

0 comments on commit bfd8076

Please sign in to comment.