ia64/linux-2.6.18-xen.hg

changeset 820:8b86d11a6eb3

netback: parent sysfs device should be set before registering.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 17 14:21:51 2009 +0000 (2009-03-17)
parents e8a9f8910a3f
children 6669e480cb59
files drivers/xen/netback/common.h drivers/xen/netback/interface.c drivers/xen/netback/xenbus.c
line diff
     1.1 --- a/drivers/xen/netback/common.h	Fri Mar 13 10:08:22 2009 +0000
     1.2 +++ b/drivers/xen/netback/common.h	Tue Mar 17 14:21:51 2009 +0000
     1.3 @@ -182,7 +182,7 @@ void netif_accel_init(void);
     1.4  
     1.5  void netif_disconnect(netif_t *netif);
     1.6  
     1.7 -netif_t *netif_alloc(domid_t domid, unsigned int handle);
     1.8 +netif_t *netif_alloc(struct device *parent, domid_t domid, unsigned int handle);
     1.9  int netif_map(netif_t *netif, unsigned long tx_ring_ref,
    1.10  	      unsigned long rx_ring_ref, unsigned int evtchn);
    1.11  
     2.1 --- a/drivers/xen/netback/interface.c	Fri Mar 13 10:08:22 2009 +0000
     2.2 +++ b/drivers/xen/netback/interface.c	Tue Mar 17 14:21:51 2009 +0000
     2.3 @@ -175,7 +175,7 @@ static struct ethtool_ops network_ethtoo
     2.4  	.get_strings = netbk_get_strings,
     2.5  };
     2.6  
     2.7 -netif_t *netif_alloc(domid_t domid, unsigned int handle)
     2.8 +netif_t *netif_alloc(struct device *parent, domid_t domid, unsigned int handle)
     2.9  {
    2.10  	int err = 0;
    2.11  	struct net_device *dev;
    2.12 @@ -189,6 +189,8 @@ netif_t *netif_alloc(domid_t domid, unsi
    2.13  		return ERR_PTR(-ENOMEM);
    2.14  	}
    2.15  
    2.16 +	SET_NETDEV_DEV(dev, parent);
    2.17 +
    2.18  	netif = netdev_priv(dev);
    2.19  	memset(netif, 0, sizeof(*netif));
    2.20  	netif->domid  = domid;
     3.1 --- a/drivers/xen/netback/xenbus.c	Fri Mar 13 10:08:22 2009 +0000
     3.2 +++ b/drivers/xen/netback/xenbus.c	Tue Mar 17 14:21:51 2009 +0000
     3.3 @@ -195,14 +195,13 @@ static void backend_create_netif(struct 
     3.4  		return;
     3.5  	}
     3.6  
     3.7 -	be->netif = netif_alloc(dev->otherend_id, handle);
     3.8 +	be->netif = netif_alloc(&dev->dev, dev->otherend_id, handle);
     3.9  	if (IS_ERR(be->netif)) {
    3.10  		err = PTR_ERR(be->netif);
    3.11  		be->netif = NULL;
    3.12  		xenbus_dev_fatal(dev, err, "creating interface");
    3.13  		return;
    3.14  	}
    3.15 -	SET_NETDEV_DEV(be->netif->dev, &dev->dev);
    3.16  
    3.17  	kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
    3.18  }