diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-09-21 14:15:57 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-27 04:31:53 +0400 |
commit | 14555b14455f9acbdf0e500ae96140828a970796 (patch) | |
tree | 544fdc46abf6257a457b816623540e768e0c9bdc /drivers/staging/iio/adc/ad7192.c | |
parent | 3811cd6291bb5a11c8d830831149d6369e7d3b68 (diff) | |
download | linux-14555b14455f9acbdf0e500ae96140828a970796.tar.xz |
staging:iio: replacing term ring with buffer in the IIO core.
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>
Diffstat (limited to 'drivers/staging/iio/adc/ad7192.c')
-rw-r--r-- | drivers/staging/iio/adc/ad7192.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 8d080ab68a3a..67d731b40649 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -455,7 +455,7 @@ out: static int ad7192_scan_from_ring(struct ad7192_state *st, unsigned ch, int *val) { - struct iio_ring_buffer *ring = iio_priv_to_dev(st)->ring; + struct iio_buffer *ring = iio_priv_to_dev(st)->buffer; int ret; s64 dat64[2]; u32 *dat32 = (u32 *)dat64; @@ -475,7 +475,7 @@ static int ad7192_scan_from_ring(struct ad7192_state *st, unsigned ch, int *val) static int ad7192_ring_preenable(struct iio_dev *indio_dev) { struct ad7192_state *st = iio_priv(indio_dev); - struct iio_ring_buffer *ring = indio_dev->ring; + struct iio_buffer *ring = indio_dev->buffer; size_t d_size; unsigned channel; @@ -494,9 +494,9 @@ static int ad7192_ring_preenable(struct iio_dev *indio_dev) d_size += sizeof(s64) - (d_size % sizeof(s64)); } - if (indio_dev->ring->access->set_bytes_per_datum) - indio_dev->ring->access->set_bytes_per_datum(indio_dev->ring, - d_size); + if (indio_dev->buffer->access->set_bytes_per_datum) + indio_dev->buffer->access-> + set_bytes_per_datum(indio_dev->buffer, d_size); st->mode = (st->mode & ~AD7192_MODE_SEL(-1)) | AD7192_MODE_SEL(AD7192_MODE_CONT); @@ -539,7 +539,7 @@ static irqreturn_t ad7192_trigger_handler(int irq, void *p) { struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; - struct iio_ring_buffer *ring = indio_dev->ring; + struct iio_buffer *ring = indio_dev->buffer; struct ad7192_state *st = iio_priv(indio_dev); s64 dat64[2]; s32 *dat32 = (s32 *)dat64; @@ -562,7 +562,7 @@ static irqreturn_t ad7192_trigger_handler(int irq, void *p) return IRQ_HANDLED; } -static const struct iio_ring_setup_ops ad7192_ring_setup_ops = { +static const struct iio_buffer_setup_ops ad7192_ring_setup_ops = { .preenable = &ad7192_ring_preenable, .postenable = &iio_triggered_buffer_postenable, .predisable = &iio_triggered_buffer_predisable, @@ -573,13 +573,13 @@ static int ad7192_register_ring_funcs_and_init(struct iio_dev *indio_dev) { int ret; - indio_dev->ring = iio_sw_rb_allocate(indio_dev); - if (!indio_dev->ring) { + indio_dev->buffer = iio_sw_rb_allocate(indio_dev); + if (!indio_dev->buffer) { ret = -ENOMEM; goto error_ret; } /* Effectively select the ring buffer implementation */ - indio_dev->ring->access = &ring_sw_access_funcs; + indio_dev->buffer->access = &ring_sw_access_funcs; indio_dev->pollfunc = iio_alloc_pollfunc(&iio_pollfunc_store_time, &ad7192_trigger_handler, IRQF_ONESHOT, @@ -592,14 +592,14 @@ static int ad7192_register_ring_funcs_and_init(struct iio_dev *indio_dev) } /* Ring buffer functions - here trigger setup related */ - indio_dev->ring->setup_ops = &ad7192_ring_setup_ops; + indio_dev->buffer->setup_ops = &ad7192_ring_setup_ops; /* Flag that polled ring buffering is possible */ indio_dev->modes |= INDIO_BUFFER_TRIGGERED; return 0; error_deallocate_sw_rb: - iio_sw_rb_free(indio_dev->ring); + iio_sw_rb_free(indio_dev->buffer); error_ret: return ret; } @@ -607,7 +607,7 @@ error_ret: static void ad7192_ring_cleanup(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); } /** @@ -705,7 +705,7 @@ static ssize_t ad7192_write_frequency(struct device *dev, return ret; mutex_lock(&indio_dev->mlock); - if (iio_ring_enabled(indio_dev)) { + if (iio_buffer_enabled(indio_dev)) { mutex_unlock(&indio_dev->mlock); return -EBUSY; } @@ -790,7 +790,7 @@ static ssize_t ad7192_set(struct device *dev, return ret; mutex_lock(&indio_dev->mlock); - if (iio_ring_enabled(indio_dev)) { + if (iio_buffer_enabled(indio_dev)) { mutex_unlock(&indio_dev->mlock); return -EBUSY; } @@ -872,7 +872,7 @@ static int ad7192_read_raw(struct iio_dev *indio_dev, switch (m) { case 0: mutex_lock(&indio_dev->mlock); - if (iio_ring_enabled(indio_dev)) + if (iio_buffer_enabled(indio_dev)) ret = ad7192_scan_from_ring(st, chan->scan_index, &smpl); else @@ -929,7 +929,7 @@ static int ad7192_write_raw(struct iio_dev *indio_dev, unsigned int tmp; mutex_lock(&indio_dev->mlock); - if (iio_ring_enabled(indio_dev)) { + if (iio_buffer_enabled(indio_dev)) { mutex_unlock(&indio_dev->mlock); return -EBUSY; } @@ -1099,9 +1099,9 @@ static int __devinit ad7192_probe(struct spi_device *spi) if (ret) goto error_unreg_ring; - ret = iio_ring_buffer_register(indio_dev, - indio_dev->channels, - indio_dev->num_channels); + ret = iio_buffer_register(indio_dev, + indio_dev->channels, + indio_dev->num_channels); if (ret) goto error_remove_trigger; @@ -1112,7 +1112,7 @@ static int __devinit ad7192_probe(struct spi_device *spi) return 0; error_uninitialize_ring: - iio_ring_buffer_unregister(indio_dev); + iio_buffer_unregister(indio_dev); error_remove_trigger: ad7192_remove_trigger(indio_dev); error_unreg_ring: @@ -1137,7 +1137,7 @@ static int ad7192_remove(struct spi_device *spi) struct iio_dev *indio_dev = spi_get_drvdata(spi); struct ad7192_state *st = iio_priv(indio_dev); - iio_ring_buffer_unregister(indio_dev); + iio_buffer_unregister(indio_dev); ad7192_remove_trigger(indio_dev); ad7192_ring_cleanup(indio_dev); |