summaryrefslogtreecommitdiff
path: root/drivers/iio/industrialio-buffer.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2017-01-02 19:28:26 +0000
committerJonathan Cameron <jic23@kernel.org>2017-01-10 19:54:50 +0000
commit9f4667776c138df33c4107fcd8811aa9cb6cdcbe (patch)
tree3e2222a63f31ff57116c3266f8c4ece5f744beea /drivers/iio/industrialio-buffer.c
parent263cf5e6577a779cc3311c5290325ef3917de2ea (diff)
iio:buffer: Introduced a function to assign the buffer specific attrs.
This is a necessary step in taking the buffer implementation opaque. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'drivers/iio/industrialio-buffer.c')
-rw-r--r--drivers/iio/industrialio-buffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 9f496eb84e0b..831537cc9500 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -209,6 +209,18 @@ void iio_buffer_init(struct iio_buffer *buffer)
}
EXPORT_SYMBOL(iio_buffer_init);
+/**
+ * iio_buffer_set_attrs - Set buffer specific attributes
+ * @buffer: The buffer for which we are setting attributes
+ * @attrs: Pointer to a null terminated list of pointers to attributes
+ */
+void iio_buffer_set_attrs(struct iio_buffer *buffer,
+ const struct attribute **attrs)
+{
+ buffer->attrs = attrs;
+}
+EXPORT_SYMBOL_GPL(iio_buffer_set_attrs);
+
static ssize_t iio_show_scan_index(struct device *dev,
struct device_attribute *attr,
char *buf)