mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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: 7c84f7f80d
("hwmon: add support for Sensirion SHT3x sensors")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
e65805251f
commit
991f9fa903
@ -720,7 +720,7 @@ static int sht3x_probe(struct i2c_client *client,
|
|||||||
data->setup.blocking_io = false;
|
data->setup.blocking_io = false;
|
||||||
data->setup.high_precision = true;
|
data->setup.high_precision = true;
|
||||||
data->mode = 0;
|
data->mode = 0;
|
||||||
data->last_update = 0;
|
data->last_update = jiffies - msecs_to_jiffies(3000);
|
||||||
data->client = client;
|
data->client = client;
|
||||||
crc8_populate_msb(sht3x_crc8_table, SHT3X_CRC8_POLYNOMIAL);
|
crc8_populate_msb(sht3x_crc8_table, SHT3X_CRC8_POLYNOMIAL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user