diff options
author | Roland Stigge <stigge@antcom.de> | 2011-01-21 09:57:28 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-22 06:32:21 -0800 |
commit | 41135b1ca228b6ea1a0ab9d903dd54396ebd485d (patch) | |
tree | 9142512ee9286c59a656304c7f0f38398c8f58ec | |
parent | 01446ef5af4e8802369bf4d257806e24345a9371 (diff) | |
download | blackbird-op-linux-41135b1ca228b6ea1a0ab9d903dd54396ebd485d.tar.gz blackbird-op-linux-41135b1ca228b6ea1a0ab9d903dd54396ebd485d.zip |
Staging: iio: Aditional fixpoint formatted output bugfix
iio: Additional fixpoint formatted output bugfixes
Fix some ADC/DAC drivers' _scale interface to correct fixpoint formatted output
This patch adds the fixes to ad7887_core.c and ad5446.c
Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/iio/adc/ad7887_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/dac/ad5446.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/adc/ad7887_core.c b/drivers/staging/iio/adc/ad7887_core.c index 685908995d49..5d85efab658c 100644 --- a/drivers/staging/iio/adc/ad7887_core.c +++ b/drivers/staging/iio/adc/ad7887_core.c @@ -68,7 +68,7 @@ static ssize_t ad7887_show_scale(struct device *dev, /* Corresponds to Vref / 2^(bits) */ unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); } static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0); diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c index e3387cd31145..0f87ecac82fc 100644 --- a/drivers/staging/iio/dac/ad5446.c +++ b/drivers/staging/iio/dac/ad5446.c @@ -87,7 +87,7 @@ static ssize_t ad5446_show_scale(struct device *dev, /* Corresponds to Vref / 2^(bits) */ unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); } static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); |