iio: iio_format_value(): Fix IIO_VAL_FRACTIONAL_LOG2 values between -1.0 and 0.0
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 15 Dec 2020 19:17:42 +0000 (20:17 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 11 Mar 2021 20:47:00 +0000 (20:47 +0000)
commit38a52cdef5b3ba2e4ac6b24a073a231e04d2c552
tree89f1497b65c9db3f05553839c22b7b20f4cafc17
parent2646a95df94e5d2aaeb22fa912179831ebd0095b
iio: iio_format_value(): Fix IIO_VAL_FRACTIONAL_LOG2 values between -1.0 and 0.0

When formatting a value using IIO_VAL_FRACTIONAL_LOG2 and the values is
between -1 and 0 the sign is omitted.

We need the same trick as for IIO_VAL_FRACTIONAL to make sure this gets
formatted correctly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201215191743.2725-2-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c