Re: [PATCH v4] iio: accel: adxl345: separate event state from query errors

From: berringtoni36

Date: Sun Oct 25 2026 - 02:06:29 EST


Hi Jonathan,

Thank you for applying both ADXL345 fixes. Noted on the threading:
I'll send each future revision as a new email thread.

Best regards,
Wenqiang

On Sat, 24 Oct 2026 03:49:31 +0100, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> On Mon, 19 Oct 2026 21:05:20 +0800
> Wenqiang Zhao via B4 Relay <devnull+berringtoni36.gmail.com@xxxxxxxxxx> wrote:
>
> > From: Wenqiang Zhao <berringtoni36@xxxxxxxxx>
> >
> > The activity/inactivity query helpers return either a boolean result or a
> > negative regmap error. adxl345_read_mag_config() converts the latter to 1
> > with !!, reporting a failed read as an enabled event. The disable path
> > also turns a coupling query error into a successful write.
> >
> > Return query status separately from the boolean result by passing bool
> > output parameters to both helpers. Rename them from is_* to get_* and
> > update the event read, disable and link-bit callers to check the status
> > before using the result. Preserve the successful coupling-mismatch
> > no-op when disabling an event.
> >
> > Fixes: 66a1af6d8a63 ("iio: accel: adxl345: add activity event feature")
> > Fixes: 31f7679bb69a ("iio: accel: adxl345: add coupling detection for activity/inactivity")
> > Assisted-by: LLM
> > Signed-off-by: Wenqiang Zhao <berringtoni36@xxxxxxxxx>
> For future patches, please don't reply to an existing thread with a new version.
> It can cause trouble for tooling and generally makes them harder to spot.
> New email thread for each version.
>
> This seems fine to me, so applied. I'm not rushing this one in though
> as it doesn't feel very urgent so applied to the testing branch of iio.git.
>
> Thanks,
>
> Jonathan