Skip to contentSkip to conversation

fix modalias content in sysfs for macio devices

PATCH New Olaf Hering 1 participant 1 message Apr 2, 2007 Linux for power macintosh

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/macintosh/macio_sysfs.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/macintosh/macio_sysfs.c +4 -2
Index: b/drivers/macintosh/macio_sysfs.c
===================================================================
@@ -53,12 +53,14 @@ static ssize_t modalias_show (struct dev
 	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;
 }