summaryrefslogtreecommitdiff
path: root/drivers/iio/industrialio-triggered-buffer.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-12-10 10:22:40 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-12-10 10:22:40 +0400
commit5d43889c07bb38694742936aa70d1187c012e198 (patch)
tree73809dddae39ae3b746396e9779142dbd1973f33 /drivers/iio/industrialio-triggered-buffer.c
parent95f75e91588afecfb0090988393653d21f5d1f91 (diff)
parent374b105797c3d4f29c685f3be535c35f5689b30e (diff)
downloadlinux-5d43889c07bb38694742936aa70d1187c012e198.tar.xz
Merge tag 'v3.13-rc3' into for-linus
Merging with the mainline to sync up on changes to serio core.
Diffstat (limited to 'drivers/iio/industrialio-triggered-buffer.c')
-rw-r--r--drivers/iio/industrialio-triggered-buffer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/iio/industrialio-triggered-buffer.c b/drivers/iio/industrialio-triggered-buffer.c
index 46c619b0d8c5..d6f54930b34a 100644
--- a/drivers/iio/industrialio-triggered-buffer.c
+++ b/drivers/iio/industrialio-triggered-buffer.c
@@ -17,7 +17,6 @@
#include <linux/iio/trigger_consumer.h>
static const struct iio_buffer_setup_ops iio_triggered_buffer_setup_ops = {
- .preenable = &iio_sw_buffer_preenable,
.postenable = &iio_triggered_buffer_postenable,
.predisable = &iio_triggered_buffer_predisable,
};
@@ -47,14 +46,17 @@ int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
irqreturn_t (*pollfunc_th)(int irq, void *p),
const struct iio_buffer_setup_ops *setup_ops)
{
+ struct iio_buffer *buffer;
int ret;
- indio_dev->buffer = iio_kfifo_allocate(indio_dev);
- if (!indio_dev->buffer) {
+ buffer = iio_kfifo_allocate(indio_dev);
+ if (!buffer) {
ret = -ENOMEM;
goto error_ret;
}
+ iio_device_attach_buffer(indio_dev, buffer);
+
indio_dev->pollfunc = iio_alloc_pollfunc(pollfunc_bh,
pollfunc_th,
IRQF_ONESHOT,