Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220136
b: refs/heads/master
c: 858f1cc
h: refs/heads/master
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Oct 6, 2010
1 parent e7ff628 commit c1afba4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 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: 5a505da957fc2f42ce53e5b0234cdf493f4f3ab0
refs/heads/master: 858f1ccff123469fb4257e2529ef8783aabf3b62
12 changes: 5 additions & 7 deletions trunk/drivers/staging/iio/adc/ad799x_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,26 @@

int ad799x_single_channel_from_ring(struct ad799x_state *st, long mask)
{
unsigned long numvals;
struct iio_ring_buffer *ring = st->indio_dev->ring;
int count = 0, ret;
u16 *ring_data;
if (!(st->indio_dev->ring->scan_mask & mask)) {
if (!(ring->scan_mask & mask)) {
ret = -EBUSY;
goto error_ret;
}
numvals = st->indio_dev->ring->scan_count;

ring_data = kmalloc(numvals*2, GFP_KERNEL);
ring_data = kmalloc(ring->access.get_bytes_per_datum(ring), GFP_KERNEL);
if (ring_data == NULL) {
ret = -ENOMEM;
goto error_ret;
}
ret = st->indio_dev->ring->access.read_last(st->indio_dev->ring,
(u8 *) ring_data);
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 */
mask >>= 1;
while (mask) {
if (mask & st->indio_dev->ring->scan_mask)
if (mask & ring->scan_mask)
count++;
mask >>= 1;
}
Expand Down

0 comments on commit c1afba4

Please sign in to comment.