diff options
author | Matt Ranostay <mranostay@gmail.com> | 2016-07-24 20:05:32 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2016-07-31 17:56:36 -0400 |
commit | 991f9fa90360b64e8b79688d8ab0f034983a959d (patch) | |
tree | 6b38aa01c5caa0f6c55eca9f06a2679bab2e46c1 | |
parent | e65805251f2db69c9f67ed8062ab82526be5a374 (diff) |
hwmon: (sht3x) set initial jiffies to last_update
Handling the wraparound requires the data->last_update to be set to an
initial jiffies value. Otherwise on 32-bit systems you will not be able
to request a reading till the 5 minute jiffies rollover happens.
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: David Frey <david.frey@sensirion.com>
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Fixes: 7c84f7f80d6fc ("hwmon: add support for Sensirion SHT3x sensors")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/sht3x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c index b73a48832732..6ea99cd6ae79 100644 --- a/drivers/hwmon/sht3x.c +++ b/drivers/hwmon/sht3x.c | |||
@@ -720,7 +720,7 @@ static int sht3x_probe(struct i2c_client *client, | |||
720 | data->setup.blocking_io = false; | 720 | data->setup.blocking_io = false; |
721 | data->setup.high_precision = true; | 721 | data->setup.high_precision = true; |
722 | data->mode = 0; | 722 | data->mode = 0; |
723 | data->last_update = 0; | 723 | data->last_update = jiffies - msecs_to_jiffies(3000); |
724 | data->client = client; | 724 | data->client = client; |
725 | crc8_populate_msb(sht3x_crc8_table, SHT3X_CRC8_POLYNOMIAL); | 725 | crc8_populate_msb(sht3x_crc8_table, SHT3X_CRC8_POLYNOMIAL); |
726 | 726 | ||