On Fri, 8 Aug 2025 14:35:00 +0200 Andy Shevchenko andy.shevchenko@gmail.com wrote:
On Fri, Aug 8, 2025 at 9:40 AM Jean-Baptiste Maneyrol via B4 Relay devnull+jean-baptiste.maneyrol.tdk.com@kernel.org wrote:
Temperature sensor returns the temperature of the mechanical parts of the chip. If both accel and gyro are off, temperature sensor is
the temperature
also automatically turned off and return invalid data.
returns
In this case, returning EBUSY error code is better then EINVAL and
-EBUSY than -EINVAL
indicates userspace that it needs to retry reading temperature in another context.
...
/*
* Temperature data is invalid if both accel and gyro are off.
* Return EBUSY in this case.
-EBUSY
*/ if (*temp == INV_ICM42600_DATA_INVALID)
ret = -EINVAL;
ret = -EBUSY;
exit: mutex_unlock(&st->lock);
...
No need to resend just for the above, I hope Jonathan tweaks this whilst applying. Reviewed-by: Andy Shevchenko andy@kernel.org (assuming typos and signs are fixed)
Tweaked an applied to the fixes-togreg branch of iio.git. I've not marked this explicitly for stable as it's a kind of weird sort of 'fix'. If anyone wants is backported, then maybe we can consider that once it's upstream
Jonathan