Re: [PATCH v2] hwmon: (ads7871) Fix incorrect error code in voltage_show

From: Guenter Roeck

Date: Sat Mar 07 2026 - 20:25:09 EST


On Sat, Mar 07, 2026 at 05:22:26PM +0530, Tabrez Ahmed wrote:
> The voltage_show() function returns -1 when the A/D conversion
> fails to complete within the polling loop. -1 maps to -EPERM
> (operation not permitted), which does not describe the actual
> failure.
>
> Replace this -1 error code with -ETIMEDOUT to better indicate
> the timeout condition to userspace.
>
> Drop the else block after return.
>
> Note: not runtime tested due to lack of hardware.
>
> Signed-off-by: Tabrez Ahmed <tabreztalks@xxxxxxxxx>

Applied.

Thanks,
Guenter