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:
parent
83fcbfd0be
commit
b92e749c3e
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue