sensor: adltc2990: add missing return value checks
This commit adds two missing return value checks for i2c reads. Fixes #65328 Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
This commit is contained in:
parent
773257dda4
commit
8c0b3ca2fd
@ -142,7 +142,7 @@ static int adltc2990_trigger_measurement(const struct device *dev)
|
||||
}
|
||||
|
||||
static int adltc2990_fetch_property_value(const struct device *dev,
|
||||
enum adltc2990_monitoring_type type,
|
||||
enum adltc2990_monitoring_type type,
|
||||
enum adltc2990_monitor_pins pin,
|
||||
int32_t *output)
|
||||
{
|
||||
@ -187,9 +187,17 @@ static int adltc2990_fetch_property_value(const struct device *dev,
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
int ret;
|
||||
|
||||
i2c_reg_read_byte_dt(&cfg->bus, msb_address, &msb_value);
|
||||
i2c_reg_read_byte_dt(&cfg->bus, lsb_address, &lsb_value);
|
||||
ret = i2c_reg_read_byte_dt(&cfg->bus, msb_address, &msb_value);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = i2c_reg_read_byte_dt(&cfg->bus, lsb_address, &lsb_value);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
uint16_t conversion_factor;
|
||||
uint8_t negative_bit_index = 14U, sensor_val_divisor = 100U;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user