diff --git a/include/zephyr/drivers/adc/voltage_divider.h b/include/zephyr/drivers/adc/voltage_divider.h index 692442d4b3..caf6f821ff 100644 --- a/include/zephyr/drivers/adc/voltage_divider.h +++ b/include/zephyr/drivers/adc/voltage_divider.h @@ -51,7 +51,7 @@ static inline int voltage_divider_scale_dt(const struct voltage_divider_dt_spec } /* voltage scaled by voltage divider values using DT binding */ - *v_to_v = *v_to_v * spec->full_ohms / spec->output_ohms; + *v_to_v = (int64_t)*v_to_v * spec->full_ohms / spec->output_ohms; return 0; }