Re: [PATCH v2 RESEND] iio: accel: adxl345: update period cache after successful write

From: Andy Shevchenko

Date: Mon Oct 19 2026 - 06:40:16 EST


On Sun, Oct 18, 2026 at 09:42:00PM +0800, Wenqiang Zhao via B4 Relay wrote:

> The ADXL345 event-period read path returns st->inact_time_ms. The setters
> for inactivity, free-fall and the ODR-derived default currently update
> this cache before writing TIME_INACT or TIME_FF. If the regmap write
> fails, the sysfs write reports an error but a subsequent read returns
> the requested period even though it was not programmed.
>
> Update the cached period only after the corresponding regmap write
> succeeds.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Assuming that my comments may lead to a separate cleanup patch later on.

--
With Best Regards,
Andy Shevchenko