ia64/xen-unstable

changeset 6281:188c782fa9bb

Fix suspend/resume for domains with devices which are in xenstore but have no xenbus aware driver.
Information about network devices is stored in xenstore. Xenbus creates
device objects for these devices but the network driver doesn't support
finding devices over xenbus yet and thus these devices have no driver.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri Aug 19 13:05:31 2005 +0000 (2005-08-19)
parents bf1746842c46
children 66348ff38ec1 6c8c3df37bfe
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 19 12:22:27 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Aug 19 13:05:31 2005 +0000
     1.3 @@ -531,10 +531,13 @@ static struct xenbus_watch be_watch = {
     1.4  static int suspend_dev(struct device *dev, void *data)
     1.5  {
     1.6  	int err = 0;
     1.7 -	struct xenbus_driver *drv = to_xenbus_driver(dev->driver);
     1.8 -	struct xenbus_device *xdev
     1.9 -		= container_of(dev, struct xenbus_device, dev);
    1.10 +	struct xenbus_driver *drv;
    1.11 +	struct xenbus_device *xdev;
    1.12  
    1.13 +	if (dev->driver == NULL)
    1.14 +		return 0;
    1.15 +	drv = to_xenbus_driver(dev->driver);
    1.16 +	xdev = container_of(dev, struct xenbus_device, dev);
    1.17  	if (drv->suspend)
    1.18  		err = drv->suspend(xdev);
    1.19  	if (err)
    1.20 @@ -545,10 +548,13 @@ static int suspend_dev(struct device *de
    1.21  static int resume_dev(struct device *dev, void *data)
    1.22  {
    1.23  	int err = 0;
    1.24 -	struct xenbus_driver *drv = to_xenbus_driver(dev->driver);
    1.25 -	struct xenbus_device *xdev
    1.26 -		= container_of(dev, struct xenbus_device, dev);
    1.27 +	struct xenbus_driver *drv;
    1.28 +	struct xenbus_device *xdev;
    1.29  
    1.30 +	if (dev->driver == NULL)
    1.31 +		return 0;
    1.32 +	drv = to_xenbus_driver(dev->driver);
    1.33 +	xdev = container_of(dev, struct xenbus_device, dev);
    1.34  	if (drv->resume)
    1.35  		err = drv->resume(xdev);
    1.36  	if (err)