Title: [9366] trunk/drivers/staging/iio/adc/max1363_core.c: merge from upstream: staging: iio: max1363 fix bug due to scan_element directory move.
Revision
9366
Author
vapier
Date
2010-10-24 16:52:08 -0400 (Sun, 24 Oct 2010)

Log Message

merge from upstream: staging: iio: max1363 fix bug due to scan_element directory move.

From: Jonathan Cameron <[email protected]>

    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 <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>

Signed-off-by: Greg Kroah-Hartman <[email protected]>

Modified Paths

Diff

Modified: trunk/drivers/staging/iio/adc/max1363_core.c (9365 => 9366)


--- trunk/drivers/staging/iio/adc/max1363_core.c	2010-10-24 20:52:04 UTC (rev 9365)
+++ trunk/drivers/staging/iio/adc/max1363_core.c	2010-10-24 20:52:08 UTC (rev 9366)
@@ -151,7 +151,8 @@
 				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);
 }
@@ -160,7 +161,8 @@
 				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);
 }
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to