Skip to content

Commit 5403f28

Browse files
Mircea Capriorujic23
authored andcommitted
iio: core: Fix handling of 'dB'
This patch fixes the call to iio_str_to_fixpoint when using 'dB' sufix. Before this the scale_db was not used when parsing the string written to the attribute and it failed with invalid value. Fixes: b852822 ("iio: core: Handle 'dB' suffix in core") Signed-off-by: Mircea Caprioru <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 6f63c90 commit 5403f28

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/iio/industrialio-core.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -909,14 +909,11 @@ static ssize_t iio_write_channel_info(struct device *dev,
909909
return -EINVAL;
910910
integer = ch;
911911
} else {
912-
ret = iio_str_to_fixpoint(buf, fract_mult, &integer, &fract);
912+
ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract,
913+
scale_db);
913914
if (ret)
914915
return ret;
915916
}
916-
ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract,
917-
scale_db);
918-
if (ret)
919-
return ret;
920917

921918
ret = indio_dev->info->write_raw(indio_dev, this_attr->c,
922919
integer, fract, this_attr->address);

0 commit comments

Comments
 (0)