WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] netback: parent sysfs device should be set before registering
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 16 Mar 2009 22:01:08 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 16 Mar 2009 15:01:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] netback: parent sysfs device should be set before registering, Ian Campbell <=