Re: [PATCH] iio: gyro: adxrs290: propagate chip ID read errors
From: Andy Shevchenko
Date: Thu Nov 19 2026 - 05:13:00 EST
On Thu, Nov 19, 2026 at 11:07:09AM +0800, Siqi Chen wrote:
> spi_w8r8() returns either an unsigned 8-bit value or a negative error.
> The probe function stores its return value in a u8, truncating errors and
> treating them as unexpected chip IDs. Consequently, an SPI transfer failure
> is reported as -ENODEV instead of the actual error.
>
> Store each result in an int and return negative errors before validating
> the chip IDs.
Starting from here the rest of the commit message should be moved to the
comment block (after '---' line).
> OpenCode was used to identify the issue and draft the code and changelog.
>
> Compile-tested with CONFIG_ADXRS290=m using:
>
> make O=/tmp/opencode/linux-build-adxrs290 W=1 \
> drivers/iio/gyro/adxrs290.o
>
> No hardware or SPI fault-injection testing was performed.
...
Code wise seems good to me.
--
With Best Regards,
Andy Shevchenko