Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7d87b3c5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron
Browse files

iio: tsl4531: fix error handling in tsl4531_check_id()



The tsl4531_check_id() function returned 1 on "found" and 0 on "not
found" and negative error codes on failure.  This was non-standard and
bug prone.  The caller treated all non-zero values including error codes
as "found".

This patch fixes it by changing the tsl4531_check_id() to return zero on
success or a negative error code, and updates the caller.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarPeter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent aff268cd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment