diff options
author | Jacopo Mondi <jacopo+renesas@jmondi.org> | 2017-05-09 09:57:57 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-05-14 17:38:55 +0200 |
commit | c54517196811b0561079833c147083ab2c9cc5e1 (patch) | |
tree | 750b3ddd48c5d3cb4f4c38fe6dccaa0d72e8fcf9 /drivers/iio/adc/max9611.c | |
parent | iio: adc: ti_am335x_adc: allocating too much in probe (diff) | |
download | linux-c54517196811b0561079833c147083ab2c9cc5e1.tar.xz linux-c54517196811b0561079833c147083ab2c9cc5e1.zip |
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: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/max9611.c')
-rw-r--r-- | drivers/iio/adc/max9611.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c index dc3869bf3248..b0526e4b9530 100644 --- a/drivers/iio/adc/max9611.c +++ b/drivers/iio/adc/max9611.c @@ -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)); unsigned int i, r; - i = max9611->shunt_resistor_uohm / 1000; - r = max9611->shunt_resistor_uohm % 1000; + i = max9611->shunt_resistor_uohm / 1000000; + 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, |