diff options
author | Alexandru Ardelean <alexandru.ardelean@analog.com> | 2021-02-15 13:40:32 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-03-11 23:47:04 +0300 |
commit | 3e3d11b2e43b9a967d98261250c19636b893b7ed (patch) | |
tree | 6b2f3b0b3665fa66e43627cbec9031e53710ddcc /include/linux/iio/sysfs.h | |
parent | d9a625744ed0e452f5c495cd8c51eed4b6623a4c (diff) | |
download | linux-3e3d11b2e43b9a967d98261250c19636b893b7ed.tar.xz |
iio: add reference to iio buffer on iio_dev_attr
This change adds a reference to a 'struct iio_buffer' object on the
iio_dev_attr object. This way, we can use the created iio_dev_attr objects
on per-buffer basis (since they're allocated anyway).
A minor downside of this change is that the number of parameters on
__iio_add_chan_devattr() grows by 1. This looks like it could do with a bit
of a re-think.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210215104043.91251-14-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/iio/sysfs.h')
-rw-r--r-- | include/linux/iio/sysfs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h index b532c875bc24..e51fba66de4b 100644 --- a/include/linux/iio/sysfs.h +++ b/include/linux/iio/sysfs.h @@ -9,6 +9,7 @@ #ifndef _INDUSTRIAL_IO_SYSFS_H_ #define _INDUSTRIAL_IO_SYSFS_H_ +struct iio_buffer; struct iio_chan_spec; /** @@ -17,12 +18,14 @@ struct iio_chan_spec; * @address: associated register address * @l: list head for maintaining list of dynamically created attrs * @c: specification for the underlying channel + * @buffer: the IIO buffer to which this attribute belongs to (if any) */ struct iio_dev_attr { struct device_attribute dev_attr; u64 address; struct list_head l; struct iio_chan_spec const *c; + struct iio_buffer *buffer; }; #define to_iio_dev_attr(_dev_attr) \ |