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

[Xen-devel] [PATCH] netback: parent sysfs device should be set before registering



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1237240760 0
# Node ID da10dce6f58a47b09b7d8cb1ec121b872377049a
# Parent  e8a9f8910a3f113759906e493eaa211e2c43cd85
netback: parent sysfs device should be set before registering.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r e8a9f8910a3f -r da10dce6f58a drivers/xen/netback/common.h
--- a/drivers/xen/netback/common.h      Fri Mar 13 10:08:22 2009 +0000
+++ b/drivers/xen/netback/common.h      Mon Mar 16 21:59:20 2009 +0000
@@ -182,7 +182,7 @@ void netif_accel_init(void);
 
 void netif_disconnect(netif_t *netif);
 
-netif_t *netif_alloc(domid_t domid, unsigned int handle);
+netif_t *netif_alloc(struct device *parent, domid_t domid, unsigned int 
handle);
 int netif_map(netif_t *netif, unsigned long tx_ring_ref,
              unsigned long rx_ring_ref, unsigned int evtchn);
 
diff -r e8a9f8910a3f -r da10dce6f58a drivers/xen/netback/interface.c
--- a/drivers/xen/netback/interface.c   Fri Mar 13 10:08:22 2009 +0000
+++ b/drivers/xen/netback/interface.c   Mon Mar 16 21:59:20 2009 +0000
@@ -175,7 +175,7 @@ static struct ethtool_ops network_ethtoo
        .get_strings = netbk_get_strings,
 };
 
-netif_t *netif_alloc(domid_t domid, unsigned int handle)
+netif_t *netif_alloc(struct device *parent, domid_t domid, unsigned int handle)
 {
        int err = 0;
        struct net_device *dev;
@@ -188,6 +188,8 @@ netif_t *netif_alloc(domid_t domid, unsi
                DPRINTK("Could not create netif: out of memory\n");
                return ERR_PTR(-ENOMEM);
        }
+
+       SET_NETDEV_DEV(dev, parent);
 
        netif = netdev_priv(dev);
        memset(netif, 0, sizeof(*netif));
diff -r e8a9f8910a3f -r da10dce6f58a drivers/xen/netback/xenbus.c
--- a/drivers/xen/netback/xenbus.c      Fri Mar 13 10:08:22 2009 +0000
+++ b/drivers/xen/netback/xenbus.c      Mon Mar 16 21:59:20 2009 +0000
@@ -195,14 +195,13 @@ static void backend_create_netif(struct 
                return;
        }
 
-       be->netif = netif_alloc(dev->otherend_id, handle);
+       be->netif = netif_alloc(&dev->dev, dev->otherend_id, handle);
        if (IS_ERR(be->netif)) {
                err = PTR_ERR(be->netif);
                be->netif = NULL;
                xenbus_dev_fatal(dev, err, "creating interface");
                return;
        }
-       SET_NETDEV_DEV(be->netif->dev, &dev->dev);
 
        kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
 }

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


 


Rackspace

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