diff options
Diffstat (limited to 'drivers/macintosh/macio_sysfs.c')
-rw-r--r-- | drivers/macintosh/macio_sysfs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c index 8566bdfdd4b8..cc8267912656 100644 --- a/drivers/macintosh/macio_sysfs.c +++ b/drivers/macintosh/macio_sysfs.c | |||
@@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf) | |||
21 | int length = 0; | 21 | int length = 0; |
22 | 22 | ||
23 | of = &to_macio_device (dev)->ofdev; | 23 | of = &to_macio_device (dev)->ofdev; |
24 | compat = get_property(of->node, "compatible", &cplen); | 24 | compat = of_get_property(of->node, "compatible", &cplen); |
25 | if (!compat) { | 25 | if (!compat) { |
26 | *buf = '\0'; | 26 | *buf = '\0'; |
27 | return 0; | 27 | return 0; |
@@ -47,18 +47,20 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, | |||
47 | int length; | 47 | int length; |
48 | 48 | ||
49 | of = &to_macio_device (dev)->ofdev; | 49 | of = &to_macio_device (dev)->ofdev; |
50 | compat = get_property(of->node, "compatible", &cplen); | 50 | compat = of_get_property(of->node, "compatible", &cplen); |
51 | if (!compat) compat = "", cplen = 1; | 51 | if (!compat) compat = "", cplen = 1; |
52 | length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type); | 52 | length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type); |
53 | buf += length; | 53 | buf += length; |
54 | while (cplen > 0) { | 54 | while (cplen > 0) { |
55 | int l; | 55 | int l; |
56 | length += sprintf (buf, "C%s", compat); | 56 | l = sprintf (buf, "C%s", compat); |
57 | buf += length; | 57 | length += l; |
58 | buf += l; | ||
58 | l = strlen (compat) + 1; | 59 | l = strlen (compat) + 1; |
59 | compat += l; | 60 | compat += l; |
60 | cplen -= l; | 61 | cplen -= l; |
61 | } | 62 | } |
63 | length += sprintf(buf, "\n"); | ||
62 | 64 | ||
63 | return length; | 65 | return length; |
64 | } | 66 | } |