]> asedeno.scripts.mit.edu Git - linux.git/commit
staging: iio: tsl2x7x: correctly return errors in tsl2x7x_get_prox()
authorBrian Masney <masneyb@onstation.org>
Sun, 4 Mar 2018 01:49:36 +0000 (20:49 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 10 Mar 2018 14:41:47 +0000 (14:41 +0000)
commit07ab2f4fac0f6ef62d8201713068bfbc8cba7f1a
treeca86310342b28be6af7e126afa94cc23d63e9563
parenta0722d05a19542616a42b6239165d7ac9c542057
staging: iio: tsl2x7x: correctly return errors in tsl2x7x_get_prox()

Not all errors that occurred in tsl2x7x_get_prox() were correctly
reported in the return value. This patch changes the error handling
so that errors are now returned properly.

Note that the ret variable is from the call to tsl2x7x_read_status(),
and it already has the correct error check. The -EINVAL error code is
for an unexpected value in the register.

This patch also corrects an unnecessary word wrap in the call to
le16_to_cpup() while changes are being made to this code.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/light/tsl2x7x.c