diff options
| author | Tabrez Ahmed <tabreztalks@gmail.com> | 2026-03-08 18:17:14 +0530 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-03-30 19:45:06 -0700 |
| commit | 487a9ab28fdd4df773b68c953e69a6f6ecc2fe68 (patch) | |
| tree | b3705c5b5a8a50d1a2f5d9fc007cb4c843956af7 /tools/lib/python/kdoc/python_version.py | |
| parent | 0a42986b65776759490ac960910651c1e4634b17 (diff) | |
hwmon: (ads7871) Propagate SPI errors in voltage_show
The voltage_show() function previously ignored negative error codes
returned by the underlying SPI read/write functions. Because negative
numbers have their most significant bits set in two's complement, a
failed SPI read returning -EIO (-5) would incorrectly evaluate to true
when masked with MUX_CNV_BM (0x80).
This would cause the driver to enter the polling loop even when the SPI bus
failed, eventually returning a misleading -ETIMEDOUT error to userspace
instead of the actual hardware error. Furthermore, the return values of
the initial SPI write and the final 16-bit SPI read were completely
ignored.
Add proper error checking after every SPI operation to ensure hardware
failures are immediately propagated back to userspace.
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tabrez Ahmed <tabreztalks@gmail.com>
Link: https://lore.kernel.org/r/20260308124714.84715-1-tabreztalks@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
