summaryrefslogtreecommitdiffstats
path: root/drivers/iio/magnetometer/mag3110.c
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2014-10-01 22:59:00 +0200
committerJonathan Cameron <jic23@kernel.org>2014-02-08 11:06:27 +0100
commit71bd89454d4cd6a4d0304aa8c3304ed8b0a294dc (patch)
tree93341e9b0b90f9e4c60e94de978f990885cf7d98 /drivers/iio/magnetometer/mag3110.c
parentiio:magnetometer:mag3110: Report busy in _read_raw() / write_raw() when buffe... (diff)
downloadlinux-71bd89454d4cd6a4d0304aa8c3304ed8b0a294dc.tar.xz
linux-71bd89454d4cd6a4d0304aa8c3304ed8b0a294dc.zip
iio:magnetometer:mag3110: Fix output of decimal digits in show_int_plus_micros()
need to print leading zeros, hence "%d.%06d" Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/magnetometer/mag3110.c')
-rw-r--r--drivers/iio/magnetometer/mag3110.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
index b88cb44f87ce..f66955fb3509 100644
--- a/drivers/iio/magnetometer/mag3110.c
+++ b/drivers/iio/magnetometer/mag3110.c
@@ -106,7 +106,7 @@ static ssize_t mag3110_show_int_plus_micros(char *buf,
while (n-- > 0)
len += scnprintf(buf + len, PAGE_SIZE - len,
- "%d.%d ", vals[n][0], vals[n][1]);
+ "%d.%06d ", vals[n][0], vals[n][1]);
/* replace trailing space by newline */
buf[len - 1] = '\n';