diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-05-14 16:10:07 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-05-17 14:10:24 +0100 |
commit | 7fce54ace336f076c5bac062b80005ef575cd4d9 (patch) | |
tree | 10bc54da4866d0d6fd8b7d1ad603faee3b8f099c /drivers/iio | |
parent | bd1455615f402c63458492875dce4d848cbb2210 (diff) |
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>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/light/tsl2591.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c index 2bdae388ff01..26e3cb6c4ff8 100644 --- a/drivers/iio/light/tsl2591.c +++ b/drivers/iio/light/tsl2591.c @@ -213,7 +213,7 @@ static int tsl2591_gain_to_multiplier(const u8 als_gain) } } -static u8 tsl2591_multiplier_to_gain(const u32 multiplier) +static int tsl2591_multiplier_to_gain(const u32 multiplier) { switch (multiplier) { case TSL2591_CTRL_ALS_LOW_GAIN_MULTIPLIER: @@ -783,8 +783,8 @@ static int tsl2591_write_raw(struct iio_dev *indio_dev, int val, int val2, long mask) { struct tsl2591_chip *chip = iio_priv(indio_dev); - u32 int_time; - u8 gain; + int int_time; + int gain; int ret; mutex_lock(&chip->als_mutex); |