Skip to content

Commit

Permalink
staging: iio: sca3000 fix bug due to scan_element directory move.
Browse files Browse the repository at this point in the history
The device found passed to the attr functions is that of the ring
buffer, not the the iio_dev so we need to bounce through one more
hop to get the right address.

Reported-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Oct 7, 2010
1 parent 0986452 commit 7aa3bae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/iio/accel/sca3000_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ static ssize_t sca3000_show_ring_bpse(struct device *dev,
{
int len = 0, ret;
u8 *rx;
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct iio_ring_buffer *ring = dev_get_drvdata(dev);
struct iio_dev *indio_dev = ring->indio_dev;
struct sca3000_state *st = indio_dev->dev_data;

mutex_lock(&st->lock);
Expand Down Expand Up @@ -168,7 +169,8 @@ static ssize_t sca3000_store_ring_bpse(struct device *dev,
const char *buf,
size_t len)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct iio_ring_buffer *ring = dev_get_drvdata(dev);
struct iio_dev *indio_dev = ring->indio_dev;
struct sca3000_state *st = indio_dev->dev_data;
int ret;
u8 *rx;
Expand Down

0 comments on commit 7aa3bae

Please sign in to comment.