diff options
author | Brian Masney <masneyb@onstation.org> | 2016-11-12 13:19:29 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-11-13 13:07:25 +0000 |
commit | 043c1da79472d7b030a4f7df40e2889e15c979a5 (patch) | |
tree | 2f91f1fda39ab08831a775ac1fa52fd9876504ef /drivers/staging/iio | |
parent | 2a1e3f074c5dd60b0d0cbd28b95efd4be77a62e7 (diff) | |
download | linux-043c1da79472d7b030a4f7df40e2889e15c979a5.tar.gz linux-043c1da79472d7b030a4f7df40e2889e15c979a5.tar.bz2 linux-043c1da79472d7b030a4f7df40e2889e15c979a5.zip |
staging: iio: tsl2583: updated code comment to match what the code does
If channel 0 does not have any data, then the code sets the lux to zero.
The corresponding comment says that the last value is returned. This
updates the comment to correctly reflect what the code does. It also
clarifies the comment about why 0 is returned.
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/light/tsl2583.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index abd0663f9691..e11820e8c710 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c @@ -221,7 +221,11 @@ static int tsl2583_get_lux(struct iio_dev *indio_dev) goto return_max; if (!ch0) { - /* have no data, so return LAST VALUE */ + /* + * The sensor appears to be in total darkness so set the + * calculated lux to 0 and return early to avoid a division by + * zero below when calculating the ratio. + */ ret = 0; chip->als_cur_info.lux = 0; goto done; |