Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c4f4ecb7a421e0be6632d3366f0bc7cdf1e38b1
Commit:     2c4f4ecb7a421e0be6632d3366f0bc7cdf1e38b1
Parent:     cb4812358423e7ea47d2b6471918d65238452cc5
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 11 18:15:59 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 04:04:13 2007 -0700

    [SPARC64]: Add domain-services nodes to VIO device tree.
    
    They sit under the root of the MD tree unlike the rest of
    the LDC channel based virtual devices.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/kernel/vio.c |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c
index 21c015e..7eccc91 100644
--- a/arch/sparc64/kernel/vio.c
+++ b/arch/sparc64/kernel/vio.c
@@ -104,18 +104,24 @@ static ssize_t devspec_show(struct device *dev,
        struct vio_dev *vdev = to_vio_dev(dev);
        const char *str = "none";
 
-       if (vdev->type) {
-               if (!strcmp(vdev->type, "network"))
-                       str = "vnet";
-               else if (!strcmp(vdev->type, "block"))
-                       str = "vdisk";
-       }
+       if (!strcmp(vdev->type, "network"))
+               str = "vnet";
+       else if (!strcmp(vdev->type, "block"))
+               str = "vdisk";
 
        return sprintf(buf, "%s\n", str);
 }
 
+static ssize_t type_show(struct device *dev,
+               struct device_attribute *attr, char *buf)
+{
+       struct vio_dev *vdev = to_vio_dev(dev);
+       return sprintf(buf, "%s\n", vdev->type);
+}
+
 static struct device_attribute vio_dev_attrs[] = {
        __ATTR_RO(devspec),
+       __ATTR_RO(type),
        __ATTR_NULL
 };
 
@@ -201,8 +207,11 @@ static struct vio_dev *vio_create_one(struct mdesc_node 
*mp,
        int err, clen;
 
        type = md_get_property(mp, "device-type", NULL);
-       if (!type)
+       if (!type) {
                type = md_get_property(mp, "name", NULL);
+               if (!type)
+                       type = mp->name;
+       }
        compat = md_get_property(mp, "device-type", &clen);
 
        vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
@@ -279,6 +288,8 @@ static void walk_tree(struct mdesc_node *n, struct vio_dev 
*parent)
 
 static void create_devices(struct mdesc_node *root)
 {
+       struct mdesc_node *mp;
+
        root_vdev = vio_create_one(root, NULL);
        if (!root_vdev) {
                printk(KERN_ERR "VIO: Coult not create root device.\n");
@@ -286,6 +297,17 @@ static void create_devices(struct mdesc_node *root)
        }
 
        walk_tree(root, root_vdev);
+
+       /* Domain services is odd as it doesn't sit underneath the
+        * channel-devices node, so we plug it in manually.
+        */
+       mp = md_find_node_by_name(NULL, "domain-services");
+       if (mp) {
+               struct vio_dev *parent = vio_create_one(mp, &root_vdev->dev);
+
+               if (parent)
+                       walk_tree(mp, parent);
+       }
 }
 
 const char *channel_devices_node = "channel-devices";
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to