Commit c5451719 authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Jonathan Cameron

iio: adc: max9611: Fix attribute measure unit

The power and current "shunt-resistor" attribute's 'show' function
displays the resistor value in milli-Ohms, while the ABI description
specifies it should be displayed in Ohms. Fix it.
Reported-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 5ba5b437
...@@ -438,10 +438,10 @@ static ssize_t max9611_shunt_resistor_show(struct device *dev, ...@@ -438,10 +438,10 @@ static ssize_t max9611_shunt_resistor_show(struct device *dev,
struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev)); struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev));
unsigned int i, r; unsigned int i, r;
i = max9611->shunt_resistor_uohm / 1000; i = max9611->shunt_resistor_uohm / 1000000;
r = max9611->shunt_resistor_uohm % 1000; r = max9611->shunt_resistor_uohm % 1000000;
return sprintf(buf, "%u.%03u\n", i, r); return sprintf(buf, "%u.%06u\n", i, r);
} }
static IIO_DEVICE_ATTR(in_power_shunt_resistor, 0444, static IIO_DEVICE_ATTR(in_power_shunt_resistor, 0444,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment