mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 06:21:31 +00:00
[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>
This commit is contained in:
parent
9414715a7b
commit
6c2d046980
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue