提交 6c2d0469 编写于 作者: O Olaf Hering 提交者: 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: NOlaf Hering <olaf@aepfle.de>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 9414715a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册