diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-08-30 11:32:47 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-06 22:59:10 (GMT) |
commit | 1aa042783251c27a93e31929c24647729db326d4 (patch) | |
tree | 137aba5136332c8c8ad7d2cdd5d194084751f0f5 /drivers/staging/iio/accel/sca3000_ring.c | |
parent | 6356463cf4627f599547f0698853ef419b2d2f1d (diff) | |
download | linux-1aa042783251c27a93e31929c24647729db326d4.tar.xz |
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/accel/sca3000_ring.c')
-rw-r--r-- | drivers/staging/iio/accel/sca3000_ring.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c index 0b736db..cc38521e 100644 --- a/drivers/staging/iio/accel/sca3000_ring.c +++ b/drivers/staging/iio/accel/sca3000_ring.c @@ -144,11 +144,6 @@ static int sca3000_ring_get_bytes_per_datum(struct iio_ring_buffer *r) { return 6; } -static void sca3000_ring_release(struct device *dev) -{ - struct iio_ring_buffer *r = to_iio_ring_buffer(dev); - kfree(iio_to_hw_ring_buf(r)); -} static IIO_RING_ENABLE_ATTR; static IIO_RING_BYTES_PER_DATUM_ATTR; @@ -258,16 +253,7 @@ static struct attribute *sca3000_ring_attributes[] = { static struct attribute_group sca3000_ring_attr = { .attrs = sca3000_ring_attributes, -}; - -static const struct attribute_group *sca3000_ring_attr_groups[] = { - &sca3000_ring_attr, - NULL -}; - -static struct device_type sca3000_ring_type = { - .release = sca3000_ring_release, - .groups = sca3000_ring_attr_groups, + .name = "buffer", }; static struct iio_ring_buffer *sca3000_rb_allocate(struct iio_dev *indio_dev) @@ -282,18 +268,15 @@ static struct iio_ring_buffer *sca3000_rb_allocate(struct iio_dev *indio_dev) ring->private = indio_dev; buf = &ring->buf; buf->stufftoread = 0; + buf->attrs = &sca3000_ring_attr; iio_ring_buffer_init(buf, indio_dev); - buf->dev.type = &sca3000_ring_type; - buf->dev.parent = &indio_dev->dev; - dev_set_drvdata(&buf->dev, (void *)buf); return buf; } static inline void sca3000_rb_free(struct iio_ring_buffer *r) { - if (r) - iio_put_ring_buffer(r); + kfree(iio_to_hw_ring_buf(r)); } static const struct iio_ring_access_funcs sca3000_ring_access_funcs = { |