Re: [PATCH v2 6/6] iio: imu: bmi270: Add scale and sampling frequency to BMI270 IMU
From: Jonathan Cameron
Date: Sat Oct 19 2024 - 07:44:29 EST
On Fri, 18 Oct 2024 16:36:12 -0700
Justin Weiss <justin@xxxxxxxxxxxxxxx> wrote:
> Add read and write functions and create _available entries.
>
> Signed-off-by: Justin Weiss <justin@xxxxxxxxxxxxxxx>
Hi Justin,
Just one trivial comment from me.
Jonathan
> +
> +static int bmi270_write_raw(struct iio_dev *indio_dev,
> + struct iio_chan_spec const *chan,
> + int val, int val2, long mask)
> +{
> + struct bmi270_data *data = iio_priv(indio_dev);
> +
> + switch (mask) {
> + case IIO_CHAN_INFO_SCALE:
> + return bmi270_set_scale(data, chan->type, val2);
> + case IIO_CHAN_INFO_SAMP_FREQ:
> + return bmi270_set_odr(data, chan->type, val, val2);
> + default:
> + return -EINVAL;
> + }
> +
Unreachable code, so drop this return.
> + return 0;
> +}
>