diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-26 18:55:15 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-12-12 12:28:33 +0000 |
commit | 08e7e0adaa17205f86894157d86c4bee3c714330 (patch) | |
tree | 15d98c47f3eafdf539e8921c7cda4571eb9a67c3 /drivers/iio/kfifo_buf.c | |
parent | d967cb6bd4e79c0cd7b150f1382d3d04e00408a0 (diff) | |
download | linux-08e7e0adaa17205f86894157d86c4bee3c714330.tar.gz |
iio: buffer: Allocate standard attributes in the core
All buffers want at least the length and the enable attribute. Move the
creation of those attributes to the core instead of having to do this in
each individual buffer implementation. This allows us to get rid of some
boiler-plate code.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/kfifo_buf.c')
-rw-r--r-- | drivers/iio/kfifo_buf.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c index 1258b4e0a722..3b0a3bc4f0ad 100644 --- a/drivers/iio/kfifo_buf.c +++ b/drivers/iio/kfifo_buf.c @@ -52,20 +52,6 @@ static int iio_get_length_kfifo(struct iio_buffer *r) return r->length; } -static IIO_BUFFER_ENABLE_ATTR; -static IIO_BUFFER_LENGTH_ATTR; - -static struct attribute *iio_kfifo_attributes[] = { - &dev_attr_length.attr, - &dev_attr_enable.attr, - NULL, -}; - -static struct attribute_group iio_kfifo_attribute_group = { - .attrs = iio_kfifo_attributes, - .name = "buffer", -}; - static int iio_mark_update_needed_kfifo(struct iio_buffer *r) { struct iio_kfifo *kf = iio_to_kfifo(r); @@ -169,7 +155,6 @@ struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev) return NULL; kf->update_needed = true; iio_buffer_init(&kf->buffer); - kf->buffer.attrs = &iio_kfifo_attribute_group; kf->buffer.access = &kfifo_access_funcs; kf->buffer.length = 2; mutex_init(&kf->user_lock); |