]> git.baikalelectronics.ru Git - kernel.git/commit
staging: iio: tsl2x7x: check return value from tsl2x7x_invoke_change()
authorBrian Masney <masneyb@onstation.org>
Thu, 6 Jul 2017 22:56:26 +0000 (18:56 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 9 Jul 2017 17:46:25 +0000 (18:46 +0100)
commit5c688f460bc194883d929835b42520db3123a031
tree605747f544bc55f70f797e0ac985a58ef5f0f24d
parentcd682b879bdaaf70fad15078822fee6b1ebb8c6c
staging: iio: tsl2x7x: check return value from tsl2x7x_invoke_change()

The return value from tsl2x7x_invoke_change() was not checked in most
places in the driver. This patch adds the proper error checks. The
return values inside tsl2x7x_invoke_change() are now checked by
this patch as well.

Previously, if there was an error turning the chip back on, then the
driver would attempt to turn the chip off and incorrectly return
success. The code to power off the chip is removed by this patch
since we should fail fast.

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