Commit 6c2d0469 authored by Olaf Hering's avatar Olaf Hering Committed by Paul Mackerras

[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: default avatarOlaf Hering <olaf@aepfle.de>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 9414715a
...@@ -53,12 +53,14 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, ...@@ -53,12 +53,14 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
buf += length; buf += length;
while (cplen > 0) { while (cplen > 0) {
int l; int l;
length += sprintf (buf, "C%s", compat); l = sprintf (buf, "C%s", compat);
buf += length; length += l;
buf += l;
l = strlen (compat) + 1; l = strlen (compat) + 1;
compat += l; compat += l;
cplen -= l; cplen -= l;
} }
length += sprintf(buf, "\n");
return length; return length;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment