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

staging:iio:accel:lis3l02dq remove sw_ring support.

The sw_ring buffer is being removed in favour of the kfifo version.
This is one of only a couple of driver still supporting its use.

This driver will hopefully also be removed in favour of supporting the
part in the unified ST accelerometer driver.

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

+4 -34
+1 -22
drivers/staging/iio/accel/Kconfig
··· 67 67 tristate "ST Microelectronics LIS3L02DQ Accelerometer Driver" 68 68 depends on SPI 69 69 select IIO_TRIGGER if IIO_BUFFER 70 - depends on !IIO_BUFFER || IIO_KFIFO_BUF || IIO_SW_RING 70 + depends on !IIO_BUFFER || IIO_KFIFO_BUF 71 71 depends on GENERIC_GPIO 72 72 help 73 73 Say yes here to build SPI support for the ST microelectronics 74 74 accelerometer. The driver supplies direct access via sysfs files 75 75 and an event interface via a character device. 76 - 77 - choice 78 - prompt "Buffer type" 79 - depends on LIS3L02DQ && IIO_BUFFER 80 - 81 - config LIS3L02DQ_BUF_KFIFO 82 - depends on IIO_KFIFO_BUF 83 - bool "Simple FIFO" 84 - help 85 - Kfifo based FIFO. Does not provide any events so it is up 86 - to userspace to ensure it reads often enough that data is not 87 - lost. 88 - 89 - config LIS3L02DQ_BUF_RING_SW 90 - depends on IIO_SW_RING 91 - bool "IIO Software Ring" 92 - help 93 - Original IIO ring buffer implementation. Provides simple 94 - buffer events, half full etc. 95 - 96 - endchoice 97 76 98 77 config SCA3000 99 78 depends on IIO_BUFFER
-8
drivers/staging/iio/accel/lis3l02dq.h
··· 185 185 int lis3l02dq_configure_buffer(struct iio_dev *indio_dev); 186 186 void lis3l02dq_unconfigure_buffer(struct iio_dev *indio_dev); 187 187 188 - #ifdef CONFIG_LIS3L02DQ_BUF_RING_SW 189 - #define lis3l02dq_free_buf iio_sw_rb_free 190 - #define lis3l02dq_alloc_buf iio_sw_rb_allocate 191 - #endif 192 - #ifdef CONFIG_LIS3L02DQ_BUF_KFIFO 193 - #define lis3l02dq_free_buf iio_kfifo_free 194 - #define lis3l02dq_alloc_buf iio_kfifo_allocate 195 - #endif 196 188 irqreturn_t lis3l02dq_data_rdy_trig_poll(int irq, void *private); 197 189 #define lis3l02dq_th lis3l02dq_data_rdy_trig_poll 198 190
+3 -4
drivers/staging/iio/accel/lis3l02dq_ring.c
··· 7 7 #include <linux/export.h> 8 8 9 9 #include <linux/iio/iio.h> 10 - #include "../ring_sw.h" 11 10 #include <linux/iio/kfifo_buf.h> 12 11 #include <linux/iio/trigger.h> 13 12 #include <linux/iio/trigger_consumer.h> ··· 317 318 void lis3l02dq_unconfigure_buffer(struct iio_dev *indio_dev) 318 319 { 319 320 iio_dealloc_pollfunc(indio_dev->pollfunc); 320 - lis3l02dq_free_buf(indio_dev->buffer); 321 + iio_kfifo_free(indio_dev->buffer); 321 322 } 322 323 323 324 static int lis3l02dq_buffer_postenable(struct iio_dev *indio_dev) ··· 400 401 int ret; 401 402 struct iio_buffer *buffer; 402 403 403 - buffer = lis3l02dq_alloc_buf(indio_dev); 404 + buffer = iio_kfifo_allocate(indio_dev); 404 405 if (!buffer) 405 406 return -ENOMEM; 406 407 ··· 426 427 return 0; 427 428 428 429 error_iio_sw_rb_free: 429 - lis3l02dq_free_buf(indio_dev->buffer); 430 + iio_kfifo_free(indio_dev->buffer); 430 431 return ret; 431 432 }