diff options
| author | 2026-03-08 18:17:14 +0530 | |
|---|---|---|
| committer | 2026-03-30 19:45:06 -0700 | |
| commit | 487a9ab28fdd4df773b68c953e69a6f6ecc2fe68 (patch) | |
| tree | b3705c5b5a8a50d1a2f5d9fc007cb4c843956af7 /tools/perf/scripts/python/stackcollapse.py | |
| parent | hwmon: (pmbus/max31785) fix argument type for i2c_smbus_write_byte_data wrapper (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/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
