Commit 7fce54ac authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

iio: light: tsl2591: fix some signedness bugs

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

Fixes: 2335f0d7 ("iio: light: Added AMS tsl2591 driver implementation")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YJ52r1XZ44myD9Xx@mwandaSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent bd145561
...@@ -213,7 +213,7 @@ static int tsl2591_gain_to_multiplier(const u8 als_gain) ...@@ -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) { switch (multiplier) {
case TSL2591_CTRL_ALS_LOW_GAIN_MULTIPLIER: case TSL2591_CTRL_ALS_LOW_GAIN_MULTIPLIER:
...@@ -783,8 +783,8 @@ static int tsl2591_write_raw(struct iio_dev *indio_dev, ...@@ -783,8 +783,8 @@ static int tsl2591_write_raw(struct iio_dev *indio_dev,
int val, int val2, long mask) int val, int val2, long mask)
{ {
struct tsl2591_chip *chip = iio_priv(indio_dev); struct tsl2591_chip *chip = iio_priv(indio_dev);
u32 int_time; int int_time;
u8 gain; int gain;
int ret; int ret;
mutex_lock(&chip->als_mutex); mutex_lock(&chip->als_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment