]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.arch/ppc-vio-modalias.patch
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.arch / ppc-vio-modalias.patch
CommitLineData
00e5a55c
BS
1From: Olaf Hering <olh@novell.com>
2Subject: [PATCH] poweroc: vio modalias
3
4Acked-by: Olaf Hering <olh@novell.com>
5---
6 arch/powerpc/kernel/vio.c | 15 +++++++++++++++
7 1 file changed, 15 insertions(+)
8
9--- a/arch/powerpc/kernel/vio.c
10+++ b/arch/powerpc/kernel/vio.c
11@@ -1315,9 +1315,24 @@ static ssize_t devspec_show(struct devic
12 return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
13 }
14
15+static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
16+ char *buf)
17+{
18+ struct device_node *of_node = dev->archdata.of_node;
19+ const char *compat;
20+ int i = 0;
21+
22+ if (of_node) {
23+ compat = of_get_property(of_node, "compatible", &i);
24+ i = sprintf (buf, "vio:T%sS%s\n", of_node->type, compat);
25+ }
26+ return i;
27+}
28+
29 static struct device_attribute vio_dev_attrs[] = {
30 __ATTR_RO(name),
31 __ATTR_RO(devspec),
32+ __ATTR_RO(modalias),
33 __ATTR_NULL
34 };
35