Skip to content

Commit

Permalink
staging: iio: max1363 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>

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 7aa3bae commit a7861ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/iio/adc/max1363_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ static ssize_t max1363_show_precision_u(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct iio_dev *dev_info = dev_get_drvdata(dev);
struct iio_ring_buffer *ring = dev_get_drvdata(dev);
struct iio_dev *dev_info = ring->indio_dev;
struct max1363_state *st = iio_dev_get_devdata(dev_info);
return sprintf(buf, "u%d/16\n", st->chip_info->bits);
}
Expand All @@ -160,7 +161,8 @@ static ssize_t max1363_show_precision_s(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct iio_dev *dev_info = dev_get_drvdata(dev);
struct iio_ring_buffer *ring = dev_get_drvdata(dev);
struct iio_dev *dev_info = ring->indio_dev;
struct max1363_state *st = iio_dev_get_devdata(dev_info);
return sprintf(buf, "s%d/16\n", st->chip_info->bits);
}
Expand Down

0 comments on commit a7861ff

Please sign in to comment.