diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-01 12:20:20 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-01 12:20:20 -0700 |
commit | d7563ca5bfca53398e100eb74345c5d3ef06bf9d (patch) | |
tree | 21b72506b3517bbbb15e73e756416b3cff833cb5 /drivers/iio/light/tsl2772.c | |
parent | 652788a90d8e4603104582fd1e2fcb95afad13d9 (diff) | |
parent | ebc2dc5f9b231c1b64047c6717cd464104f086f4 (diff) | |
download | linux-d7563ca5bfca53398e100eb74345c5d3ef06bf9d.tar.bz2 |
Merge tag 'staging-4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO fixes from Greg KH:
"Here are a few small staging and IIO driver fixes for 4.18-rc3.
Nothing major or big, all just fixes for reported problems since
4.18-rc1. All of these have been in linux-next this week with no
reported problems"
* tag 'staging-4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: android: ion: Return an ERR_PTR in ion_map_kernel
staging: comedi: quatech_daqp_cs: fix no-op loop daqp_ao_insn_write()
iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
iio: buffer: fix the function signature to match implementation
iio: mma8452: Fix ignoring MMA8452_INT_DRDY
iio: tsl2x7x/tsl2772: avoid potential division by zero
iio: pressure: bmp280: fix relative humidity unit
Diffstat (limited to 'drivers/iio/light/tsl2772.c')
-rw-r--r-- | drivers/iio/light/tsl2772.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c index 34d42a2504c9..df5b2a0da96c 100644 --- a/drivers/iio/light/tsl2772.c +++ b/drivers/iio/light/tsl2772.c @@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev) "%s: failed to get lux\n", __func__); return lux_val; } + if (lux_val == 0) + return -ERANGE; ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / lux_val; |