Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging:iio:meter:ade7758 switch from sw_ring to kfifo

sw ring is going away so switch over to kfifo based buffer implementation.
The only real change is that poll will return on some data there rather than
buffer 50% full.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>

+7 -7
+1 -1
drivers/staging/iio/meter/Kconfig
··· 21 21 tristate "Analog Devices ADE7758 Poly Phase Multifunction Energy Metering IC Driver" 22 22 depends on SPI 23 23 select IIO_TRIGGER if IIO_BUFFER 24 - select IIO_SW_RING if IIO_BUFFER 24 + select IIO_KFIFO_BUF if IIO_BUFFER 25 25 help 26 26 Say yes here to build support for Analog Devices ADE7758 Polyphase 27 27 Multifunction Energy Metering IC with Per Phase Information Driver.
+6 -6
drivers/staging/iio/meter/ade7758_ring.c
··· 13 13 #include <asm/unaligned.h> 14 14 15 15 #include <linux/iio/iio.h> 16 - #include "../ring_sw.h" 16 + #include <linux/iio/kfifo_buf.h> 17 17 #include <linux/iio/trigger_consumer.h> 18 18 #include "ade7758.h" 19 19 ··· 119 119 void ade7758_unconfigure_ring(struct iio_dev *indio_dev) 120 120 { 121 121 iio_dealloc_pollfunc(indio_dev->pollfunc); 122 - iio_sw_rb_free(indio_dev->buffer); 122 + iio_kfifo_free(indio_dev->buffer); 123 123 } 124 124 125 125 int ade7758_configure_ring(struct iio_dev *indio_dev) ··· 127 127 struct ade7758_state *st = iio_priv(indio_dev); 128 128 int ret = 0; 129 129 130 - indio_dev->buffer = iio_sw_rb_allocate(indio_dev); 130 + indio_dev->buffer = iio_kfifo_allocate(indio_dev); 131 131 if (!indio_dev->buffer) { 132 132 ret = -ENOMEM; 133 133 return ret; ··· 143 143 indio_dev->id); 144 144 if (indio_dev->pollfunc == NULL) { 145 145 ret = -ENOMEM; 146 - goto error_iio_sw_rb_free; 146 + goto error_iio_kfifo_free; 147 147 } 148 148 149 149 indio_dev->modes |= INDIO_BUFFER_TRIGGERED; ··· 183 183 184 184 return 0; 185 185 186 - error_iio_sw_rb_free: 187 - iio_sw_rb_free(indio_dev->buffer); 186 + error_iio_kfifo_free: 187 + iio_kfifo_free(indio_dev->buffer); 188 188 return ret; 189 189 } 190 190