Jesse Keating 2f82dd
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
Jesse Keating 2f82dd
index f988672..12a0851 100644
Jesse Keating 2f82dd
--- a/arch/powerpc/kernel/vio.c
Jesse Keating 2f82dd
+++ b/arch/powerpc/kernel/vio.c
Jesse Keating 2f82dd
@@ -294,9 +294,27 @@ static ssize_t devspec_show(struct device *dev,
Jesse Keating 2f82dd
 	return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
Jesse Keating 2f82dd
 }
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
Jesse Keating 2f82dd
+			     char *buf)
Jesse Keating 2f82dd
+{
Jesse Keating 2f82dd
+	const struct vio_dev *vio_dev = to_vio_dev(dev);
Jesse Keating 2f82dd
+	struct device_node *dn;
Jesse Keating 2f82dd
+	const char *cp;
Jesse Keating 2f82dd
+
Jesse Keating 2f82dd
+	dn = dev->archdata.of_node;
Jesse Keating 2f82dd
+	if (!dn)
Jesse Keating 2f82dd
+		return -ENODEV;
Jesse Keating 2f82dd
+	cp = of_get_property(dn, "compatible", NULL);
Jesse Keating 2f82dd
+	if (!cp)
Jesse Keating 2f82dd
+		return -ENODEV;
Jesse Keating 2f82dd
+
Jesse Keating 2f82dd
+	return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
Jesse Keating 2f82dd
+}
Jesse Keating 2f82dd
+
Jesse Keating 2f82dd
 static struct device_attribute vio_dev_attrs[] = {
Jesse Keating 2f82dd
 	__ATTR_RO(name),
Jesse Keating 2f82dd
 	__ATTR_RO(devspec),
Jesse Keating 2f82dd
+	__ATTR_RO(modalias),
Jesse Keating 2f82dd
 	__ATTR_NULL
Jesse Keating 2f82dd
 };
Jesse Keating 2f82dd