ia64/xen-unstable

changeset 11213:1818ea221bfe

[XENBUS] A few cleanups.
* move function prototypes to the top of the file.
* uses the "struct bus_type" function pointers instead
of overwriting the "struct device_driver" ones for
xenbus_dev_probe() and xenbus_dev_remove().

Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
author kaf24@localhost.localdomain
date Sat Aug 19 10:15:01 2006 +0100 (2006-08-19)
parents ca9f3a7b1b03
children cadf1df88d3e
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	Fri Aug 18 17:59:26 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Sat Aug 19 10:15:01 2006 +0100
     1.3 @@ -66,6 +66,14 @@ static struct notifier_block *xenstore_c
     1.4  
     1.5  static void wait_for_devices(struct xenbus_driver *xendrv);
     1.6  
     1.7 +static int xenbus_probe_frontend(const char *type, const char *name);
     1.8 +static int xenbus_uevent_backend(struct device *dev, char **envp,
     1.9 +				 int num_envp, char *buffer, int buffer_size);
    1.10 +static int xenbus_probe_backend(const char *type, const char *domid);
    1.11 +
    1.12 +static int xenbus_dev_probe(struct device *_dev);
    1.13 +static int xenbus_dev_remove(struct device *_dev);
    1.14 +
    1.15  /* If something in array of ids matches this device, return it. */
    1.16  static const struct xenbus_device_id *
    1.17  match_device(const struct xenbus_device_id *arr, struct xenbus_device *dev)
    1.18 @@ -174,15 +182,16 @@ static int read_frontend_details(struct 
    1.19  
    1.20  
    1.21  /* Bus type for frontend drivers. */
    1.22 -static int xenbus_probe_frontend(const char *type, const char *name);
    1.23  static struct xen_bus_type xenbus_frontend = {
    1.24  	.root = "device",
    1.25  	.levels = 2, 		/* device/type/<id> */
    1.26  	.get_bus_id = frontend_bus_id,
    1.27  	.probe = xenbus_probe_frontend,
    1.28  	.bus = {
    1.29 -		.name  = "xen",
    1.30 -		.match = xenbus_match,
    1.31 +		.name     = "xen",
    1.32 +		.match    = xenbus_match,
    1.33 +		.probe    = xenbus_dev_probe,
    1.34 +		.remove   = xenbus_dev_remove,
    1.35  	},
    1.36  	.dev = {
    1.37  		.bus_id = "xen",
    1.38 @@ -227,18 +236,17 @@ static int backend_bus_id(char bus_id[BU
    1.39  	return 0;
    1.40  }
    1.41  
    1.42 -static int xenbus_uevent_backend(struct device *dev, char **envp,
    1.43 -				 int num_envp, char *buffer, int buffer_size);
    1.44 -static int xenbus_probe_backend(const char *type, const char *domid);
    1.45  static struct xen_bus_type xenbus_backend = {
    1.46  	.root = "backend",
    1.47  	.levels = 3, 		/* backend/type/<frontend>/<id> */
    1.48  	.get_bus_id = backend_bus_id,
    1.49  	.probe = xenbus_probe_backend,
    1.50  	.bus = {
    1.51 -		.name  = "xen-backend",
    1.52 -		.match = xenbus_match,
    1.53 -		.uevent = xenbus_uevent_backend,
    1.54 +		.name     = "xen-backend",
    1.55 +		.match    = xenbus_match,
    1.56 +		.probe    = xenbus_dev_probe,
    1.57 +		.remove   = xenbus_dev_remove,
    1.58 +		.uevent   = xenbus_uevent_backend,
    1.59  	},
    1.60  	.dev = {
    1.61  		.bus_id = "xen-backend",
    1.62 @@ -405,8 +413,6 @@ static int xenbus_register_driver_common
    1.63  	drv->driver.name = drv->name;
    1.64  	drv->driver.bus = &bus->bus;
    1.65  	drv->driver.owner = drv->owner;
    1.66 -	drv->driver.probe = xenbus_dev_probe;
    1.67 -	drv->driver.remove = xenbus_dev_remove;
    1.68  
    1.69  	mutex_lock(&xenwatch_mutex);
    1.70  	ret = driver_register(&drv->driver);