aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/humidity/si7020.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/humidity/si7020.c')
-rw-r--r--drivers/iio/humidity/si7020.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c
index e336af713f20..69e49f58a455 100644
--- a/drivers/iio/humidity/si7020.c
+++ b/drivers/iio/humidity/si7020.c
@@ -56,10 +56,9 @@ static int si7020_read_raw(struct iio_dev *indio_dev,
56 SI7020CMD_RH_HOLD); 56 SI7020CMD_RH_HOLD);
57 if (ret < 0) 57 if (ret < 0)
58 return ret; 58 return ret;
59 if (chan->type == IIO_TEMP) 59 *val = ret >> 2;
60 *val = ret >> 2; 60 if (chan->type == IIO_HUMIDITYRELATIVE)
61 else 61 *val &= GENMASK(11, 0);
62 *val = (ret & 0x3FFF) >> 2;
63 return IIO_VAL_INT; 62 return IIO_VAL_INT;
64 case IIO_CHAN_INFO_SCALE: 63 case IIO_CHAN_INFO_SCALE:
65 if (chan->type == IIO_TEMP) 64 if (chan->type == IIO_TEMP)
@@ -133,7 +132,6 @@ static int si7020_probe(struct i2c_client *client,
133 132
134 data = iio_priv(indio_dev); 133 data = iio_priv(indio_dev);
135 *data = client; 134 *data = client;
136 i2c_set_clientdata(client, indio_dev);
137 135
138 indio_dev->dev.parent = &client->dev; 136 indio_dev->dev.parent = &client->dev;
139 indio_dev->name = dev_name(&client->dev); 137 indio_dev->name = dev_name(&client->dev);