summary refs log tree commit diff
path: root/drivers/macintosh
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2007-04-02 14:33:27 +0200
committerPaul Mackerras <paulus@samba.org>2007-04-13 03:55:17 +1000
commit6c2d046980299d52d78b2738ad7f11fc593dea75 (patch)
treef8b58484f245f20f58f91505ad0b5e983adb2a9f /drivers/macintosh
parent9414715a7bbb45450015e9bc2676d85d919d08d4 (diff)
downloadlinux-6c2d046980299d52d78b2738ad7f11fc593dea75.tar.gz
[POWERPC] Fix modalias content in sysfs for macio devices
Currently the buf pointer is advanced too far during each iteration.
Also terminate the string with a newline.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/macio_sysfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index 8566bdfdd4b8..0a5647fb8569 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -53,12 +53,14 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
 	buf += length;
 	while (cplen > 0) {
 		int l;
-		length += sprintf (buf, "C%s", compat);
-		buf += length;
+		l = sprintf (buf, "C%s", compat);
+		length += l;
+		buf += l;
 		l = strlen (compat) + 1;
 		compat += l;
 		cplen -= l;
 	}
+	length += sprintf(buf, "\n");
 
 	return length;
 }