[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Create devices for the xenbus-bus's.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID dda0459e335c9c82996c712419cf3af5273f3eb1
# Parent  a1a998b059b1f6b7f7991fef9aee0f9cbefe0b1d
Create devices for the xenbus-bus's.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r a1a998b059b1 -r dda0459e335c 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Thu Aug 18 
19:01:09 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Thu Aug 18 
19:04:47 2005
@@ -72,6 +72,7 @@
        int (*get_bus_id)(char bus_id[BUS_ID_SIZE], const char *nodename);
        int (*probe)(const char *type, const char *dir);
        struct bus_type bus;
+       struct device dev;
 };
 
 /* device/<type>/<id> => <type>-<id> */
@@ -102,6 +103,9 @@
        .bus = {
                .name  = "xen",
                .match = xenbus_match,
+       },
+       .dev = {
+               .bus_id = "xen",
        },
 };
 
@@ -160,6 +164,9 @@
                .name  = "xen-backend",
                .match = xenbus_match,
        },
+       .dev = {
+               .bus_id = "xen-backend",
+       },
 };
 
 static int xenbus_dev_probe(struct device *_dev)
@@ -304,15 +311,16 @@
        xendev->subtype = xenbus_read(xendev->nodename, "subtype", NULL);
        if (IS_ERR(xendev->subtype))
                xendev->subtype = NULL;
-       
+
+       xendev->dev.parent = &bus->dev;
+       xendev->dev.bus = &bus->bus;
+       xendev->dev.release = xenbus_release_device;
+
        err = bus->get_bus_id(xendev->dev.bus_id, xendev->nodename);
        if (err) {
                kfree(xendev);
                return err;
        }
-
-       xendev->dev.bus = &bus->bus;
-       xendev->dev.release = xenbus_release_device;
 
        /* Register with generic device framework. */
        err = device_register(&xendev->dev);
@@ -584,6 +592,8 @@
 {
        bus_register(&xenbus_frontend.bus);
        bus_register(&xenbus_backend.bus);
+       device_register(&xenbus_frontend.dev);
+       device_register(&xenbus_backend.dev);
        
        if (!xen_start_info.store_evtchn)
                return 0;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.