Skip to content

Commit

Permalink
staging:iio: replacing term ring with buffer in the IIO core.
Browse files Browse the repository at this point in the history
They aren't always ring buffers, so just use buffer for all naming.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 27, 2011
1 parent 3811cd6 commit 14555b1
Show file tree
Hide file tree
Showing 48 changed files with 680 additions and 678 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/iio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

obj-$(CONFIG_IIO) += industrialio.o
industrialio-y := industrialio-core.o
industrialio-$(CONFIG_IIO_BUFFER) += industrialio-ring.o
industrialio-$(CONFIG_IIO_BUFFER) += industrialio-buffer.o
industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o

obj-$(CONFIG_IIO_SW_RING) += ring_sw.o
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/iio/accel/adis16201_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ static int __devinit adis16201_probe(struct spi_device *spi)
if (ret)
goto error_free_dev;

ret = iio_ring_buffer_register(indio_dev,
adis16201_channels,
ARRAY_SIZE(adis16201_channels));
ret = iio_buffer_register(indio_dev,
adis16201_channels,
ARRAY_SIZE(adis16201_channels));
if (ret) {
printk(KERN_ERR "failed to initialize the ring\n");
goto error_unreg_ring_funcs;
Expand All @@ -519,7 +519,7 @@ static int __devinit adis16201_probe(struct spi_device *spi)
error_remove_trigger:
adis16201_remove_trigger(indio_dev);
error_uninitialize_ring:
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
error_unreg_ring_funcs:
adis16201_unconfigure_ring(indio_dev);
error_free_dev:
Expand All @@ -533,7 +533,7 @@ static int adis16201_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);

adis16201_remove_trigger(indio_dev);
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
adis16201_unconfigure_ring(indio_dev);
iio_device_unregister(indio_dev);

Expand Down
14 changes: 7 additions & 7 deletions drivers/staging/iio/accel/adis16201_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct adis16201_state *st = iio_priv(indio_dev);
struct iio_ring_buffer *ring = indio_dev->ring;
struct iio_buffer *ring = indio_dev->buffer;

int i = 0;
s16 *data;
Expand Down Expand Up @@ -94,26 +94,26 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)
void adis16201_unconfigure_ring(struct iio_dev *indio_dev)
{
iio_dealloc_pollfunc(indio_dev->pollfunc);
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
}

static const struct iio_ring_setup_ops adis16201_ring_setup_ops = {
.preenable = &iio_sw_ring_preenable,
static const struct iio_buffer_setup_ops adis16201_ring_setup_ops = {
.preenable = &iio_sw_buffer_preenable,
.postenable = &iio_triggered_buffer_postenable,
.predisable = &iio_triggered_buffer_predisable,
};

int adis16201_configure_ring(struct iio_dev *indio_dev)
{
int ret = 0;
struct iio_ring_buffer *ring;
struct iio_buffer *ring;

ring = iio_sw_rb_allocate(indio_dev);
if (!ring) {
ret = -ENOMEM;
return ret;
}
indio_dev->ring = ring;
indio_dev->buffer = ring;
/* Effectively select the ring buffer implementation */
ring->bpe = 2;
ring->scan_timestamp = true;
Expand All @@ -135,6 +135,6 @@ int adis16201_configure_ring(struct iio_dev *indio_dev)
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
return ret;
}
10 changes: 5 additions & 5 deletions drivers/staging/iio/accel/adis16203_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ static int __devinit adis16203_probe(struct spi_device *spi)
if (ret)
goto error_free_dev;

ret = iio_ring_buffer_register(indio_dev,
adis16203_channels,
ARRAY_SIZE(adis16203_channels));
ret = iio_buffer_register(indio_dev,
adis16203_channels,
ARRAY_SIZE(adis16203_channels));
if (ret) {
printk(KERN_ERR "failed to initialize the ring\n");
goto error_unreg_ring_funcs;
Expand All @@ -474,7 +474,7 @@ static int __devinit adis16203_probe(struct spi_device *spi)
error_remove_trigger:
adis16203_remove_trigger(indio_dev);
error_uninitialize_ring:
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
error_unreg_ring_funcs:
adis16203_unconfigure_ring(indio_dev);
error_free_dev:
Expand All @@ -488,7 +488,7 @@ static int adis16203_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);

adis16203_remove_trigger(indio_dev);
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
adis16203_unconfigure_ring(indio_dev);
iio_device_unregister(indio_dev);

Expand Down
14 changes: 7 additions & 7 deletions drivers/staging/iio/accel/adis16203_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct adis16203_state *st = iio_priv(indio_dev);
struct iio_ring_buffer *ring = indio_dev->ring;
struct iio_buffer *ring = indio_dev->buffer;

int i = 0;
s16 *data;
Expand Down Expand Up @@ -96,26 +96,26 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
void adis16203_unconfigure_ring(struct iio_dev *indio_dev)
{
iio_dealloc_pollfunc(indio_dev->pollfunc);
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
}

static const struct iio_ring_setup_ops adis16203_ring_setup_ops = {
.preenable = &iio_sw_ring_preenable,
static const struct iio_buffer_setup_ops adis16203_ring_setup_ops = {
.preenable = &iio_sw_buffer_preenable,
.postenable = &iio_triggered_buffer_postenable,
.predisable = &iio_triggered_buffer_predisable,
};

int adis16203_configure_ring(struct iio_dev *indio_dev)
{
int ret = 0;
struct iio_ring_buffer *ring;
struct iio_buffer *ring;

ring = iio_sw_rb_allocate(indio_dev);
if (!ring) {
ret = -ENOMEM;
return ret;
}
indio_dev->ring = ring;
indio_dev->buffer = ring;
/* Effectively select the ring buffer implementation */
ring->bpe = 2;
ring->scan_timestamp = true;
Expand All @@ -138,6 +138,6 @@ int adis16203_configure_ring(struct iio_dev *indio_dev)
return 0;

error_iio_sw_rb_free:
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
return ret;
}
10 changes: 5 additions & 5 deletions drivers/staging/iio/accel/adis16204_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ static int __devinit adis16204_probe(struct spi_device *spi)
if (ret)
goto error_free_dev;

ret = iio_ring_buffer_register(indio_dev,
adis16204_channels,
ARRAY_SIZE(adis16204_channels));
ret = iio_buffer_register(indio_dev,
adis16204_channels,
ARRAY_SIZE(adis16204_channels));
if (ret) {
printk(KERN_ERR "failed to initialize the ring\n");
goto error_unreg_ring_funcs;
Expand All @@ -548,7 +548,7 @@ static int __devinit adis16204_probe(struct spi_device *spi)
error_remove_trigger:
adis16204_remove_trigger(indio_dev);
error_uninitialize_ring:
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
error_unreg_ring_funcs:
adis16204_unconfigure_ring(indio_dev);
error_free_dev:
Expand All @@ -562,7 +562,7 @@ static int adis16204_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);

adis16204_remove_trigger(indio_dev);
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
adis16204_unconfigure_ring(indio_dev);
iio_device_unregister(indio_dev);

Expand Down
14 changes: 7 additions & 7 deletions drivers/staging/iio/accel/adis16204_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct adis16204_state *st = iio_priv(indio_dev);
struct iio_ring_buffer *ring = indio_dev->ring;
struct iio_buffer *ring = indio_dev->buffer;
int i = 0;
s16 *data;
size_t datasize = ring->access->get_bytes_per_datum(ring);
Expand Down Expand Up @@ -91,26 +91,26 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)
void adis16204_unconfigure_ring(struct iio_dev *indio_dev)
{
iio_dealloc_pollfunc(indio_dev->pollfunc);
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
}

static const struct iio_ring_setup_ops adis16204_ring_setup_ops = {
.preenable = &iio_sw_ring_preenable,
static const struct iio_buffer_setup_ops adis16204_ring_setup_ops = {
.preenable = &iio_sw_buffer_preenable,
.postenable = &iio_triggered_buffer_postenable,
.predisable = &iio_triggered_buffer_predisable,
};

int adis16204_configure_ring(struct iio_dev *indio_dev)
{
int ret = 0;
struct iio_ring_buffer *ring;
struct iio_buffer *ring;

ring = iio_sw_rb_allocate(indio_dev);
if (!ring) {
ret = -ENOMEM;
return ret;
}
indio_dev->ring = ring;
indio_dev->buffer = ring;
/* Effectively select the ring buffer implementation */
ring->access = &ring_sw_access_funcs;
ring->bpe = 2;
Expand All @@ -134,6 +134,6 @@ int adis16204_configure_ring(struct iio_dev *indio_dev)
return 0;

error_iio_sw_rb_free:
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
return ret;
}
10 changes: 5 additions & 5 deletions drivers/staging/iio/accel/adis16209_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ static int __devinit adis16209_probe(struct spi_device *spi)
if (ret)
goto error_free_dev;

ret = iio_ring_buffer_register(indio_dev,
adis16209_channels,
ARRAY_SIZE(adis16209_channels));
ret = iio_buffer_register(indio_dev,
adis16209_channels,
ARRAY_SIZE(adis16209_channels));
if (ret) {
printk(KERN_ERR "failed to initialize the ring\n");
goto error_unreg_ring_funcs;
Expand All @@ -521,7 +521,7 @@ static int __devinit adis16209_probe(struct spi_device *spi)
error_remove_trigger:
adis16209_remove_trigger(indio_dev);
error_uninitialize_ring:
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
error_unreg_ring_funcs:
adis16209_unconfigure_ring(indio_dev);
error_free_dev:
Expand All @@ -537,7 +537,7 @@ static int adis16209_remove(struct spi_device *spi)
flush_scheduled_work();

adis16209_remove_trigger(indio_dev);
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
adis16209_unconfigure_ring(indio_dev);
iio_device_unregister(indio_dev);

Expand Down
14 changes: 7 additions & 7 deletions drivers/staging/iio/accel/adis16209_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct adis16209_state *st = iio_priv(indio_dev);
struct iio_ring_buffer *ring = indio_dev->ring;
struct iio_buffer *ring = indio_dev->buffer;

int i = 0;
s16 *data;
Expand Down Expand Up @@ -91,26 +91,26 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)
void adis16209_unconfigure_ring(struct iio_dev *indio_dev)
{
iio_dealloc_pollfunc(indio_dev->pollfunc);
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
}

static const struct iio_ring_setup_ops adis16209_ring_setup_ops = {
.preenable = &iio_sw_ring_preenable,
static const struct iio_buffer_setup_ops adis16209_ring_setup_ops = {
.preenable = &iio_sw_buffer_preenable,
.postenable = &iio_triggered_buffer_postenable,
.predisable = &iio_triggered_buffer_predisable,
};

int adis16209_configure_ring(struct iio_dev *indio_dev)
{
int ret = 0;
struct iio_ring_buffer *ring;
struct iio_buffer *ring;

ring = iio_sw_rb_allocate(indio_dev);
if (!ring) {
ret = -ENOMEM;
return ret;
}
indio_dev->ring = ring;
indio_dev->buffer = ring;
/* Effectively select the ring buffer implementation */
ring->access = &ring_sw_access_funcs;
ring->bpe = 2;
Expand All @@ -134,6 +134,6 @@ int adis16209_configure_ring(struct iio_dev *indio_dev)
return 0;

error_iio_sw_rb_free:
iio_sw_rb_free(indio_dev->ring);
iio_sw_rb_free(indio_dev->buffer);
return ret;
}
10 changes: 5 additions & 5 deletions drivers/staging/iio/accel/adis16240_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@ static int __devinit adis16240_probe(struct spi_device *spi)
if (ret)
goto error_free_dev;

ret = iio_ring_buffer_register(indio_dev,
adis16240_channels,
ARRAY_SIZE(adis16240_channels));
ret = iio_buffer_register(indio_dev,
adis16240_channels,
ARRAY_SIZE(adis16240_channels));
if (ret) {
printk(KERN_ERR "failed to initialize the ring\n");
goto error_unreg_ring_funcs;
Expand All @@ -573,7 +573,7 @@ static int __devinit adis16240_probe(struct spi_device *spi)
error_remove_trigger:
adis16240_remove_trigger(indio_dev);
error_uninitialize_ring:
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
error_unreg_ring_funcs:
adis16240_unconfigure_ring(indio_dev);
error_free_dev:
Expand All @@ -590,7 +590,7 @@ static int adis16240_remove(struct spi_device *spi)
flush_scheduled_work();

adis16240_remove_trigger(indio_dev);
iio_ring_buffer_unregister(indio_dev);
iio_buffer_unregister(indio_dev);
adis16240_unconfigure_ring(indio_dev);
iio_device_unregister(indio_dev);

Expand Down
Loading

0 comments on commit 14555b1

Please sign in to comment.