mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
iio: imu: lsm6dsr: make use of devm_iio_kfifo_buffer_setup() helper
According to commit17395ce299("iio: make use of devm_iio_kfifo_buffer_setup() helper") and commitf67c6c73cb("iio: core: Simplify the registration of kfifo buffers"). Also fixes the following warning: drivers/iio/imu/st_lsm6dsr/st_lsm6dsr_buffer.c:992:19: error: implicit declaration of function 'of_property_read_bool' [-Werror=implicit-function-declaration] Signed-off-by: Tao Huang <huangtao@rock-chips.com> Change-Id: Ia8229b4fe1d22c6455ea8b1eeb410a925f71e785
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <linux/iio/triggered_buffer.h>
|
||||
#include <linux/iio/trigger.h>
|
||||
#include <linux/iio/buffer.h>
|
||||
#include <linux/of.h>
|
||||
#include "st_lsm6dsr.h"
|
||||
|
||||
#define ST_LSM6DSR_REG_EMB_FUNC_STATUS_MAINPAGE 0x35
|
||||
@@ -976,7 +977,6 @@ int st_lsm6dsr_buffers_setup(struct st_lsm6dsr_hw *hw)
|
||||
{
|
||||
struct device_node *np = hw->dev->of_node;
|
||||
struct st_lsm6dsr_sensor *sensor;
|
||||
struct iio_buffer *buffer;
|
||||
struct iio_dev *iio_dev;
|
||||
unsigned long irq_type;
|
||||
int i, err;
|
||||
@@ -1014,13 +1014,10 @@ int st_lsm6dsr_buffers_setup(struct st_lsm6dsr_hw *hw)
|
||||
if (!hw->iio_devs[i])
|
||||
continue;
|
||||
|
||||
buffer = devm_iio_kfifo_allocate(hw->dev);
|
||||
if (!buffer)
|
||||
return -ENOMEM;
|
||||
|
||||
iio_device_attach_buffer(hw->iio_devs[i], buffer);
|
||||
hw->iio_devs[i]->modes |= INDIO_BUFFER_SOFTWARE;
|
||||
hw->iio_devs[i]->setup_ops = &st_lsm6dsr_fifo_ops;
|
||||
err = devm_iio_kfifo_buffer_setup(hw->dev, hw->iio_devs[i],
|
||||
&st_lsm6dsr_fifo_ops);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
err = st_lsm6dsr_fifo_init(hw);
|
||||
|
||||
Reference in New Issue
Block a user