Commit 7aa3baeb authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging: iio: sca3000 fix bug due to scan_element directory move.

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: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0986452e
...@@ -138,7 +138,8 @@ static ssize_t sca3000_show_ring_bpse(struct device *dev, ...@@ -138,7 +138,8 @@ static ssize_t sca3000_show_ring_bpse(struct device *dev,
{ {
int len = 0, ret; int len = 0, ret;
u8 *rx; 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; struct sca3000_state *st = indio_dev->dev_data;
mutex_lock(&st->lock); mutex_lock(&st->lock);
...@@ -168,7 +169,8 @@ static ssize_t sca3000_store_ring_bpse(struct device *dev, ...@@ -168,7 +169,8 @@ static ssize_t sca3000_store_ring_bpse(struct device *dev,
const char *buf, const char *buf,
size_t len) 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; struct sca3000_state *st = indio_dev->dev_data;
int ret; int ret;
u8 *rx; u8 *rx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment