ia64/xen-unstable

changeset 6259:dda0459e335c

Create devices for the xenbus-bus's.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 18 19:04:47 2005 +0000 (2005-08-18)
parents a1a998b059b1
children 2f09b40595ea
files linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Thu Aug 18 19:01:09 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Thu Aug 18 19:04:47 2005 +0000
     1.3 @@ -72,6 +72,7 @@ struct xen_bus_type
     1.4  	int (*get_bus_id)(char bus_id[BUS_ID_SIZE], const char *nodename);
     1.5  	int (*probe)(const char *type, const char *dir);
     1.6  	struct bus_type bus;
     1.7 +	struct device dev;
     1.8  };
     1.9  
    1.10  /* device/<type>/<id> => <type>-<id> */
    1.11 @@ -103,6 +104,9 @@ static struct xen_bus_type xenbus_fronte
    1.12  		.name  = "xen",
    1.13  		.match = xenbus_match,
    1.14  	},
    1.15 +	.dev = {
    1.16 +		.bus_id = "xen",
    1.17 +	},
    1.18  };
    1.19  
    1.20  /* For backends, does lookup on uuid (up to /).  Returns domid, or -errno. */
    1.21 @@ -160,6 +164,9 @@ static struct xen_bus_type xenbus_backen
    1.22  		.name  = "xen-backend",
    1.23  		.match = xenbus_match,
    1.24  	},
    1.25 +	.dev = {
    1.26 +		.bus_id = "xen-backend",
    1.27 +	},
    1.28  };
    1.29  
    1.30  static int xenbus_dev_probe(struct device *_dev)
    1.31 @@ -304,16 +311,17 @@ static int xenbus_probe_node(struct xen_
    1.32  	xendev->subtype = xenbus_read(xendev->nodename, "subtype", NULL);
    1.33  	if (IS_ERR(xendev->subtype))
    1.34  		xendev->subtype = NULL;
    1.35 -	
    1.36 +
    1.37 +	xendev->dev.parent = &bus->dev;
    1.38 +	xendev->dev.bus = &bus->bus;
    1.39 +	xendev->dev.release = xenbus_release_device;
    1.40 +
    1.41  	err = bus->get_bus_id(xendev->dev.bus_id, xendev->nodename);
    1.42  	if (err) {
    1.43  		kfree(xendev);
    1.44  		return err;
    1.45  	}
    1.46  
    1.47 -	xendev->dev.bus = &bus->bus;
    1.48 -	xendev->dev.release = xenbus_release_device;
    1.49 -
    1.50  	/* Register with generic device framework. */
    1.51  	err = device_register(&xendev->dev);
    1.52  	if (err) {
    1.53 @@ -584,6 +592,8 @@ static int __init xenbus_probe_init(void
    1.54  {
    1.55  	bus_register(&xenbus_frontend.bus);
    1.56  	bus_register(&xenbus_backend.bus);
    1.57 +	device_register(&xenbus_frontend.dev);
    1.58 +	device_register(&xenbus_backend.dev);
    1.59  	
    1.60  	if (!xen_start_info.store_evtchn)
    1.61  		return 0;