aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r--drivers/of/device.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 8a1d93a2bb81..51e5214071da 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -57,6 +57,15 @@ static ssize_t devspec_show(struct device *dev,
57 return sprintf(buf, "%s\n", ofdev->node->full_name); 57 return sprintf(buf, "%s\n", ofdev->node->full_name);
58} 58}
59 59
60static ssize_t name_show(struct device *dev,
61 struct device_attribute *attr, char *buf)
62{
63 struct of_device *ofdev;
64
65 ofdev = to_of_device(dev);
66 return sprintf(buf, "%s\n", ofdev->node->name);
67}
68
60static ssize_t modalias_show(struct device *dev, 69static ssize_t modalias_show(struct device *dev,
61 struct device_attribute *attr, char *buf) 70 struct device_attribute *attr, char *buf)
62{ 71{
@@ -71,6 +80,7 @@ static ssize_t modalias_show(struct device *dev,
71 80
72struct device_attribute of_platform_device_attrs[] = { 81struct device_attribute of_platform_device_attrs[] = {
73 __ATTR_RO(devspec), 82 __ATTR_RO(devspec),
83 __ATTR_RO(name),
74 __ATTR_RO(modalias), 84 __ATTR_RO(modalias),
75 __ATTR_NULL 85 __ATTR_NULL
76}; 86};