Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: light: tsl2591: fix some signedness bugs

These variables need to be int for the error handling to work.

Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YJ52r1XZ44myD9Xx@mwanda
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Dan Carpenter and committed by
Jonathan Cameron
7fce54ac bd145561

+3 -3
+3 -3
drivers/iio/light/tsl2591.c
··· 213 213 } 214 214 } 215 215 216 - static u8 tsl2591_multiplier_to_gain(const u32 multiplier) 216 + static int tsl2591_multiplier_to_gain(const u32 multiplier) 217 217 { 218 218 switch (multiplier) { 219 219 case TSL2591_CTRL_ALS_LOW_GAIN_MULTIPLIER: ··· 783 783 int val, int val2, long mask) 784 784 { 785 785 struct tsl2591_chip *chip = iio_priv(indio_dev); 786 - u32 int_time; 787 - u8 gain; 786 + int int_time; 787 + int gain; 788 788 int ret; 789 789 790 790 mutex_lock(&chip->als_mutex);