drivers: sensor: ina3221: fix double-promotion

channel_get was doing using floating point constants with it's calculation.
The result is changed to be a float as this was generating a double
promotion warning.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
This commit is contained in:
Ryan McClelland 2023-08-23 00:00:40 -07:00 committed by Maureen Helm
commit b92e749c3e

View file

@ -225,7 +225,7 @@ static int ina3221_channel_get(const struct device *dev, enum sensor_channel cha
{
const struct ina3221_config *cfg = dev->config;
struct ina3221_data *data = dev->data;
double result;
float result;
switch (chan) {
case SENSOR_CHAN_VOLTAGE:
@ -245,7 +245,7 @@ static int ina3221_channel_get(const struct device *dev, enum sensor_channel cha
return -ENOTSUP;
}
return sensor_value_from_double(val, result);
return sensor_value_from_float(val, result);
}
static int ina3221_attr_set(const struct device *dev, enum sensor_channel chan,