Skip to content

Commit

Permalink
[POWERPC] Fix modalias content in sysfs for macio devices
Browse files Browse the repository at this point in the history
Currently the buf pointer is advanced too far during each iteration.
Also terminate the string with a newline.

Signed-off-by: Olaf Hering <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
  • Loading branch information
olafhering authored and paulusmack committed Apr 12, 2007
1 parent 9414715 commit 6c2d046
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/macintosh/macio_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c2d046

Please sign in to comment.