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>

authored by Roland Stigge and committed by Greg Kroah-Hartman 41135b1c 01446ef5

+2 -2
+1 -1
drivers/staging/iio/adc/ad7887_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, ad7887_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, ad7887_show_scale, NULL, 0); 74
+1 -1
drivers/staging/iio/dac/ad5446.c
··· 87 /* Corresponds to Vref / 2^(bits) */ 88 unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; 89 90 - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); 91 } 92 static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); 93
··· 87 /* Corresponds to Vref / 2^(bits) */ 88 unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; 89 90 + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); 91 } 92 static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); 93