/* sht15_update_vals() - get updated readings from device if too old @data: device state  */
static int sht15_update_vals(struct sht15_data *data)
/* sht15_update_vals() - get updated readings from device if too old @data: device state  */
static int sht15_update_vals(struct sht15_data *data)
{
	int ret = 0;
	int timeout = HZ;
	mutex_lock(&data->read_lock);
	if (time_after(jiffies, data->last_updat + timeout)
	    || !data->valid) {
		data->flag = SHT15_READING_HUMID;
		ret = sht15_update_single_val(data, SHT15_MEASURE_RH, 160);
		if (ret)
			goto error_ret;
		data->flag = SHT15_READING_TEMP;
		ret = sht15_update_single_val(data, SHT15_MEASURE_TEMP, 400);
		if (ret)
			goto error_ret;
		data->valid = 1;
		data->last_updat = jiffies;
	}
error_ret:
	mutex_unlock(&data->read_lock);
	return ret;
}