Merge tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[firefly-linux-kernel-4.4.55.git] / drivers / iio / industrialio-triggered-buffer.c
index d6f54930b34af49185f6fa76dd41372a5214bc35..15a5341b5e7b303b80257db09853a2a62560b8d1 100644 (file)
@@ -32,7 +32,7 @@ static const struct iio_buffer_setup_ops iio_triggered_buffer_setup_ops = {
  *
  * This function combines some common tasks which will normally be performed
  * when setting up a triggered buffer. It will allocate the buffer and the
- * pollfunc, as well as register the buffer with the IIO core.
+ * pollfunc.
  *
  * Before calling this function the indio_dev structure should already be
  * completely initialized, but not yet registered. In practice this means that
@@ -49,7 +49,7 @@ int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
        struct iio_buffer *buffer;
        int ret;
 
-       buffer = iio_kfifo_allocate(indio_dev);
+       buffer = iio_kfifo_allocate();
        if (!buffer) {
                ret = -ENOMEM;
                goto error_ret;
@@ -78,16 +78,8 @@ int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
        /* Flag that polled ring buffering is possible */
        indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
 
-       ret = iio_buffer_register(indio_dev,
-                                 indio_dev->channels,
-                                 indio_dev->num_channels);
-       if (ret)
-               goto error_dealloc_pollfunc;
-
        return 0;
 
-error_dealloc_pollfunc:
-       iio_dealloc_pollfunc(indio_dev->pollfunc);
 error_kfifo_free:
        iio_kfifo_free(indio_dev->buffer);
 error_ret:
@@ -101,7 +93,6 @@ EXPORT_SYMBOL(iio_triggered_buffer_setup);
  */
 void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev)
 {
-       iio_buffer_unregister(indio_dev);
        iio_dealloc_pollfunc(indio_dev->pollfunc);
        iio_kfifo_free(indio_dev->buffer);
 }