summaryrefslogtreecommitdiffstats
path: root/drivers/iio/buffer
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2021-02-15 12:40:34 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-03-11 20:47:04 +0000
commit4991f3ea2aec5dd8c5abdb40a360258dd71eddf4 (patch)
tree0328a20b229ef35dbcfcc3f87da6c3caedb7a317 /drivers/iio/buffer
parent15097c7a1adc0554ce8eb6f5fd6758d063bfea44 (diff)
downloadlinux-4991f3ea2aec5dd8c5abdb40a360258dd71eddf4.tar.gz
linux-4991f3ea2aec5dd8c5abdb40a360258dd71eddf4.tar.bz2
linux-4991f3ea2aec5dd8c5abdb40a360258dd71eddf4.zip
iio: buffer: dmaengine: obtain buffer object from attribute
The reference to the IIO buffer object is stored on the attribute object. So we need to unwind it to obtain it. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20210215104043.91251-16-alexandru.ardelean@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/buffer')
-rw-r--r--drivers/iio/buffer/industrialio-buffer-dmaengine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
index 9981896e1495..a64b222289be 100644
--- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
+++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
@@ -132,9 +132,9 @@ static const struct iio_dma_buffer_ops iio_dmaengine_default_ops = {
static ssize_t iio_dmaengine_buffer_get_length_align(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+ struct iio_buffer *buffer = to_iio_dev_attr(attr)->buffer;
struct dmaengine_buffer *dmaengine_buffer =
- iio_buffer_to_dmaengine_buffer(indio_dev->buffer);
+ iio_buffer_to_dmaengine_buffer(buffer);
return sprintf(buf, "%zu\n", dmaengine_buffer->align);
}