diff options
author | Nuno Sá <[email protected]> | 2023-03-07 10:53:03 +0100 |
---|---|---|
committer | Jonathan Cameron <[email protected]> | 2023-03-12 15:25:24 +0000 |
commit | 7b3825e9487d77e83bf1e27b10a74cd729b8f972 (patch) | |
tree | 2662313ed720674607bac094dcbdc4c3407c5aac /lib/mpi/mpi-bit.c | |
parent | c3701185ee1973845db088d8b0fc443397ab0eb2 (diff) |
iio: adc: max11410: fix read_poll_timeout() usage
Even though we are passing 'ret' as stop condition for
read_poll_timeout(), that return code is still being ignored. The reason
is that the poll will stop if the passed condition is true which will
happen if the passed op() returns error. However, read_poll_timeout()
returns 0 if the *complete* condition evaluates to true. Therefore, the
error code returned by op() will be ignored.
To fix this we need to check for both error codes:
* The one returned by read_poll_timeout() which is either 0 or
ETIMEDOUT.
* The one returned by the passed op().
Fixes: a44ef7c46097 ("iio: adc: add max11410 adc driver")
Signed-off-by: Nuno Sá <[email protected]>
Acked-by: Ibrahim Tilki <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions