aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/device.c
diff options
context:
space:
mode:
authorJoachim Fenkes <fenkes@de.ibm.com>2008-08-06 00:30:18 +1000
committerPaul Mackerras <paulus@samba.org>2008-08-20 09:50:21 +1000
commit4589f1fe570c2c786b72eff146b2f168821882c6 (patch)
tree2f99262399ccce9ce1f5e0bb8f6b4d8e7d067699 /drivers/of/device.c
parent7230ced4925b07c259a62b515d8278c6bb1ad98c (diff)
downloadkernel_samsung_smdk4412-4589f1fe570c2c786b72eff146b2f168821882c6.zip
kernel_samsung_smdk4412-4589f1fe570c2c786b72eff146b2f168821882c6.tar.gz
kernel_samsung_smdk4412-4589f1fe570c2c786b72eff146b2f168821882c6.tar.bz2
powerpc/ibmebus: Restore "name" sysfs attribute on ibmebus devices
Recent of_platform changes made of_bus_type_init() overwrite the bus type's .dev_attrs list, meaning that the "name" attribute that ibmebus devices previously had is no longer present. This is a user-visible regression which breaks the userspace eHCA support, since the eHCA userspace driver relies on the name attribute to check for valid adapters. This fixes it by providing the "name" attribute in the generic OF device code instead. Tested on POWER. Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
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 8a1d93a..51e5214 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -57,6 +57,15 @@ static ssize_t devspec_show(struct device *dev,
return sprintf(buf, "%s\n", ofdev->node->full_name);
}
+static ssize_t name_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct of_device *ofdev;
+
+ ofdev = to_of_device(dev);
+ return sprintf(buf, "%s\n", ofdev->node->name);
+}
+
static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -71,6 +80,7 @@ static ssize_t modalias_show(struct device *dev,
struct device_attribute of_platform_device_attrs[] = {
__ATTR_RO(devspec),
+ __ATTR_RO(name),
__ATTR_RO(modalias),
__ATTR_NULL
};