summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/kfifo_buf.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-08-30 12:32:47 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-06 15:59:10 -0700
commit1aa042783251c27a93e31929c24647729db326d4 (patch)
tree137aba5136332c8c8ad7d2cdd5d194084751f0f5 /drivers/staging/iio/kfifo_buf.c
parent6356463cf4627f599547f0698853ef419b2d2f1d (diff)
staging: iio: push the main buffer chrdev down to the top level.
Sorry all, this one is very invasive, though the driver changes are just trivial interface fixes. Not all done yet. V2 - bring the sca3000 with us. V3 - fix ade7758 bugs in conversion. V4 - add ad5933 Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/kfifo_buf.c')
-rw-r--r--drivers/staging/iio/kfifo_buf.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/staging/iio/kfifo_buf.c b/drivers/staging/iio/kfifo_buf.c
index 3c9516b2a67..39b058557f6 100644
--- a/drivers/staging/iio/kfifo_buf.c
+++ b/drivers/staging/iio/kfifo_buf.c
@@ -87,24 +87,7 @@ static struct attribute *iio_kfifo_attributes[] = {
static struct attribute_group iio_kfifo_attribute_group = {
.attrs = iio_kfifo_attributes,
-};
-
-static const struct attribute_group *iio_kfifo_attribute_groups[] = {
- &iio_kfifo_attribute_group,
- NULL
-};
-
-static void iio_kfifo_release(struct device *dev)
-{
- struct iio_ring_buffer *r = to_iio_ring_buffer(dev);
- struct iio_kfifo *kf = iio_to_kfifo(r);
- kfifo_free(&kf->kf);
- kfree(kf);
-}
-
-static struct device_type iio_kfifo_type = {
- .release = iio_kfifo_release,
- .groups = iio_kfifo_attribute_groups,
+ .name = "buffer",
};
struct iio_ring_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev)
@@ -116,10 +99,8 @@ struct iio_ring_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev)
return NULL;
kf->update_needed = true;
iio_ring_buffer_init(&kf->ring, indio_dev);
+ kf->ring.attrs = &iio_kfifo_attribute_group;
__iio_init_kfifo(kf);
- kf->ring.dev.type = &iio_kfifo_type;
- kf->ring.dev.parent = &indio_dev->dev;
- dev_set_drvdata(&kf->ring.dev, (void *)&(kf->ring));
return &kf->ring;
}
@@ -159,8 +140,7 @@ static int iio_set_length_kfifo(struct iio_ring_buffer *r, int length)
void iio_kfifo_free(struct iio_ring_buffer *r)
{
- if (r)
- iio_put_ring_buffer(r);
+ kfree(iio_to_kfifo(r));
}
EXPORT_SYMBOL(iio_kfifo_free);