summaryrefslogtreecommitdiffstats
path: root/drivers/iio/chemical/bme680_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/chemical/bme680_core.c')
-rw-r--r--drivers/iio/chemical/bme680_core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
index 871921d81e70..6d11f9188367 100644
--- a/drivers/iio/chemical/bme680_core.c
+++ b/drivers/iio/chemical/bme680_core.c
@@ -741,6 +741,7 @@ static int bme680_read_raw(struct iio_dev *indio_dev,
{
struct bme680_data *data = iio_priv(indio_dev);
int chan_val, ret;
+ s16 temp_chan_val;
guard(mutex)(&data->lock);
@@ -757,11 +758,11 @@ static int bme680_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_PROCESSED:
switch (chan->type) {
case IIO_TEMP:
- ret = bme680_read_temp(data, (s16 *)&chan_val);
+ ret = bme680_read_temp(data, &temp_chan_val);
if (ret)
return ret;
- *val = chan_val * 10;
+ *val = temp_chan_val * 10;
return IIO_VAL_INT;
case IIO_PRESSURE:
ret = bme680_read_press(data, &chan_val);