[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcxoyoHYkSJw_OudEs7kAsaan9urhPofZQXyOyOVdBWuQ@mail.gmail.com>
Date: Fri, 25 Apr 2025 08:25:00 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Gustavo Silva <gustavograzs@...il.com>
Cc: Alex Lanzano <lanzano.alex@...il.com>, Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>, Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] iio: imu: bmi270: add support for motion events
On Fri, Apr 25, 2025 at 3:15 AM Gustavo Silva <gustavograzs@...il.com> wrote:
>
> Add support for any-motion/no-motion events based on acceleration slope
> on each axis. Threshold and duration can be configured from userspace.
I'm wondering if you are using --histogram diff algo when preparing
the patches. If not, please do so for the next version.
...
> + irq_reg = bmi270_int_map_reg(data->irq_pin);
> + if (irq_reg < 0)
> + return -EINVAL;
Why is the error code shadowed?
...
> + case IIO_EV_INFO_PERIOD:
> + if (!in_range(val, 0, 163))
162 + 1
> + return -EINVAL;
> +
> + raw = BMI270_INT_MICRO_TO_RAW(val, val2,
> + BMI270_MOTION_DURAT_SCALE);
> +
> + return bmi270_update_feature_reg(data, reg,
> + BMI270_FEAT_MOTION_DURATION_MSK,
> + FIELD_PREP(BMI270_FEAT_MOTION_DURATION_MSK,
> + raw));
...
> + case IIO_EV_TYPE_MAG:
> + reg = bmi270_motion_config_reg(dir);
> + if (reg < 0)
> + return -EINVAL;
Shadowed error code, why?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists