summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/adc/ad799x_ring.c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2012-04-30 14:06:12 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-30 14:28:10 (GMT)
commitf316983fe033ba090b2f82fb9912aae9412d2372 (patch)
tree3dcad9cfcf17303aeb0b8341c8254e3fe534ffe6 /drivers/staging/iio/adc/ad799x_ring.c
parent949fd38c7b22168bc16fea100a51c8d4a3eab144 (diff)
downloadlinux-fsl-qoriq-f316983fe033ba090b2f82fb9912aae9412d2372.tar.xz
staging: iio: adc: convert ADI drivers to use kfifo.
sw_ring is depreciated and therefore won't move out of staging. Prerequisite for lifting affected drivers is to convert them to kfifo. Update copyright. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/adc/ad799x_ring.c')
-rw-r--r--drivers/staging/iio/adc/ad799x_ring.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/iio/adc/ad799x_ring.c b/drivers/staging/iio/adc/ad799x_ring.c
index 18366b5..1c7ff44 100644
--- a/drivers/staging/iio/adc/ad799x_ring.c
+++ b/drivers/staging/iio/adc/ad799x_ring.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Michael Hennerich, Analog Devices Inc.
+ * Copyright (C) 2010-2012 Michael Hennerich, Analog Devices Inc.
* Copyright (C) 2008-2010 Jonathan Cameron
*
* This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
-#include "../ring_sw.h"
+#include <linux/iio/kfifo_buf.h>
#include <linux/iio/trigger_consumer.h>
#include "ad799x.h"
@@ -120,7 +120,7 @@ int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev)
{
int ret = 0;
- indio_dev->buffer = iio_sw_rb_allocate(indio_dev);
+ indio_dev->buffer = iio_kfifo_allocate(indio_dev);
if (!indio_dev->buffer) {
ret = -ENOMEM;
goto error_ret;
@@ -134,7 +134,7 @@ int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->id);
if (indio_dev->pollfunc == NULL) {
ret = -ENOMEM;
- goto error_deallocate_sw_rb;
+ goto error_deallocate_kfifo;
}
/* Ring buffer functions - here trigger setup related */
@@ -145,8 +145,8 @@ int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
-error_deallocate_sw_rb:
- iio_sw_rb_free(indio_dev->buffer);
+error_deallocate_kfifo:
+ iio_kfifo_free(indio_dev->buffer);
error_ret:
return ret;
}
@@ -154,5 +154,5 @@ error_ret:
void ad799x_ring_cleanup(struct iio_dev *indio_dev)
{
iio_dealloc_pollfunc(indio_dev->pollfunc);
- iio_sw_rb_free(indio_dev->buffer);
+ iio_kfifo_free(indio_dev->buffer);
}