Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281264
b: refs/heads/master
c: 729bbf5
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent 0e96154 commit 48d3aa2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 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: 790d875989845b4b2b82f17d24afc7ac396fce62
refs/heads/master: 729bbf5404d322e73b5bece968b1ca59d13474de
6 changes: 0 additions & 6 deletions trunk/drivers/staging/iio/adc/ad799x.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,9 @@ struct ad799x_platform_data {
int ad7997_8_set_scan_mode(struct ad799x_state *st, unsigned mask);

#ifdef CONFIG_AD799X_RING_BUFFER
int ad799x_single_channel_from_ring(struct iio_dev *indio_dev, int channum);
int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev);
void ad799x_ring_cleanup(struct iio_dev *indio_dev);
#else /* CONFIG_AD799X_RING_BUFFER */
int ad799x_single_channel_from_ring(struct iio_dev *indio_dev, int channum)
{
return -EINVAL;
}


static inline int
ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev)
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/iio/adc/ad799x_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ static int ad799x_read_raw(struct iio_dev *indio_dev,
case 0:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = ad799x_single_channel_from_ring(indio_dev,
chan->scan_index);
ret = -EBUSY;
else
ret = ad799x_scan_direct(st, chan->scan_index);
mutex_unlock(&indio_dev->mlock);
Expand Down
30 changes: 0 additions & 30 deletions trunk/drivers/staging/iio/adc/ad799x_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,6 @@

#include "ad799x.h"

int ad799x_single_channel_from_ring(struct iio_dev *indio_dev, int channum)
{
struct iio_buffer *ring = indio_dev->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;
/* Need a count of channels prior to this one */
count = bitmap_weight(ring->scan_mask, channum);
ret = be16_to_cpu(ring_data[count]);

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

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

0 comments on commit 48d3aa2

Please sign in to comment.