iio: Fixpoint formatted output bugfix

Fix some ADC drivers' _scale interface to correct fixpoint formatted output

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Roland Stigge and committed by Greg Kroah-Hartman e71a7fd2 9c330084

+2 -2
+1 -1
drivers/staging/iio/adc/ad7476_core.c
··· 68 /* Corresponds to Vref / 2^(bits) */ 69 unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; 70 71 - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); 72 } 73 static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); 74
··· 68 /* Corresponds to Vref / 2^(bits) */ 69 unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; 70 71 + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); 72 } 73 static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); 74
+1 -1
drivers/staging/iio/adc/ad799x_core.c
··· 432 /* Corresponds to Vref / 2^(bits) */ 433 unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; 434 435 - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); 436 } 437 438 static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0);
··· 432 /* Corresponds to Vref / 2^(bits) */ 433 unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; 434 435 + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); 436 } 437 438 static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0);