From 97e15f29236f2e5780cd3e48ba97b9835b814338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Anikiel?= Date: Mon, 18 Sep 2023 09:39:33 +0000 Subject: [PATCH] drivers: sensor: ntc-thermistor: Fix flipped condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the flipped condition inside this if statement. Signed-off-by: Paweł Anikiel --- drivers/sensor/ntc_thermistor/ntc_thermistor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sensor/ntc_thermistor/ntc_thermistor.c b/drivers/sensor/ntc_thermistor/ntc_thermistor.c index 18c3b291645..8a73f391807 100644 --- a/drivers/sensor/ntc_thermistor/ntc_thermistor.c +++ b/drivers/sensor/ntc_thermistor/ntc_thermistor.c @@ -39,7 +39,7 @@ static int ntc_thermistor_sample_fetch(const struct device *dev, enum sensor_cha adc_sequence_init_dt(&cfg->adc_channel, &sequence); res = adc_read(cfg->adc_channel.dev, &sequence); - if (res) { + if (!res) { val_mv = data->raw; res = adc_raw_to_millivolts_dt(&cfg->adc_channel, &val_mv); data->sample_val = val_mv;