Skip to content

Commit

Permalink
iio: light: tsl2591: fix some signedness bugs
Browse files Browse the repository at this point in the history
These variables need to be int for the error handling to work.

Fixes: 2335f0d ("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>
  • Loading branch information
Dan Carpenter authored and Jonathan Cameron committed May 17, 2021
1 parent bd14556 commit 7fce54a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/iio/light/tsl2591.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7fce54a

Please sign in to comment.