aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/macio_sysfs.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index 112e5ef728f1..9e9453b58425 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -44,7 +44,7 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
44 struct of_device *ofdev = to_of_device(dev); 44 struct of_device *ofdev = to_of_device(dev);
45 int len; 45 int len;
46 46
47 len = of_device_get_modalias(ofdev, buf, PAGE_SIZE); 47 len = of_device_get_modalias(ofdev, buf, PAGE_SIZE - 2);
48 48
49 buf[len] = '\n'; 49 buf[len] = '\n';
50 buf[len+1] = 0; 50 buf[len+1] = 0;
@@ -52,6 +52,15 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
52 return len+1; 52 return len+1;
53} 53}
54 54
55static ssize_t devspec_show(struct device *dev,
56 struct device_attribute *attr, char *buf)
57{
58 struct of_device *ofdev;
59
60 ofdev = to_of_device(dev);
61 return sprintf(buf, "%s\n", ofdev->node->full_name);
62}
63
55macio_config_of_attr (name, "%s\n"); 64macio_config_of_attr (name, "%s\n");
56macio_config_of_attr (type, "%s\n"); 65macio_config_of_attr (type, "%s\n");
57 66
@@ -60,5 +69,6 @@ struct device_attribute macio_dev_attrs[] = {
60 __ATTR_RO(type), 69 __ATTR_RO(type),
61 __ATTR_RO(compatible), 70 __ATTR_RO(compatible),
62 __ATTR_RO(modalias), 71 __ATTR_RO(modalias),
72 __ATTR_RO(devspec),
63 __ATTR_NULL 73 __ATTR_NULL
64}; 74};