37 lines
919 B
Diff
37 lines
919 B
Diff
From: Olaf Hering <olh@novell.com>
|
|
Subject: [PATCH] poweroc: vio modalias
|
|
Patch-mainline: not yet
|
|
|
|
Acked-by: Olaf Hering <olh@novell.com>
|
|
---
|
|
arch/powerpc/kernel/vio.c | 15 +++++++++++++++
|
|
1 file changed, 15 insertions(+)
|
|
|
|
--- a/arch/powerpc/kernel/vio.c
|
|
+++ b/arch/powerpc/kernel/vio.c
|
|
@@ -1319,9 +1319,24 @@ static ssize_t devspec_show(struct devic
|
|
return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
|
|
}
|
|
|
|
+static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
|
|
+ char *buf)
|
|
+{
|
|
+ struct device_node *of_node = dev->archdata.of_node;
|
|
+ const char *compat;
|
|
+ int i = 0;
|
|
+
|
|
+ if (of_node) {
|
|
+ compat = of_get_property(of_node, "compatible", &i);
|
|
+ i = sprintf (buf, "vio:T%sS%s\n", of_node->type, compat);
|
|
+ }
|
|
+ return i;
|
|
+}
|
|
+
|
|
static struct device_attribute vio_dev_attrs[] = {
|
|
__ATTR_RO(name),
|
|
__ATTR_RO(devspec),
|
|
+ __ATTR_RO(modalias),
|
|
__ATTR_NULL
|
|
};
|
|
|