Commit 4b40eed7 authored by Wang Chen's avatar Wang Chen Committed by David S. Miller

infiniband: Kill directly reference of netdev->priv

This use of netdev->priv is wrong.
The right way is:
alloc_netdev() with no memory for private data.
make netdev->ml_priv to point to c2_dev.
Signed-off-by: default avatarWang Chen <wangchen@cn.fujitsu.com>
Acked-by: default avatarRoland Dreier <rolandd@cisco.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 486bf8de
...@@ -653,7 +653,7 @@ static int c2_service_destroy(struct iw_cm_id *cm_id) ...@@ -653,7 +653,7 @@ static int c2_service_destroy(struct iw_cm_id *cm_id)
static int c2_pseudo_up(struct net_device *netdev) static int c2_pseudo_up(struct net_device *netdev)
{ {
struct in_device *ind; struct in_device *ind;
struct c2_dev *c2dev = netdev->priv; struct c2_dev *c2dev = netdev->ml_priv;
ind = in_dev_get(netdev); ind = in_dev_get(netdev);
if (!ind) if (!ind)
...@@ -678,7 +678,7 @@ static int c2_pseudo_up(struct net_device *netdev) ...@@ -678,7 +678,7 @@ static int c2_pseudo_up(struct net_device *netdev)
static int c2_pseudo_down(struct net_device *netdev) static int c2_pseudo_down(struct net_device *netdev)
{ {
struct in_device *ind; struct in_device *ind;
struct c2_dev *c2dev = netdev->priv; struct c2_dev *c2dev = netdev->ml_priv;
ind = in_dev_get(netdev); ind = in_dev_get(netdev);
if (!ind) if (!ind)
...@@ -746,14 +746,14 @@ static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev) ...@@ -746,14 +746,14 @@ static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev)
/* change ethxxx to iwxxx */ /* change ethxxx to iwxxx */
strcpy(name, "iw"); strcpy(name, "iw");
strcat(name, &c2dev->netdev->name[3]); strcat(name, &c2dev->netdev->name[3]);
netdev = alloc_netdev(sizeof(*netdev), name, setup); netdev = alloc_netdev(0, name, setup);
if (!netdev) { if (!netdev) {
printk(KERN_ERR PFX "%s - etherdev alloc failed", printk(KERN_ERR PFX "%s - etherdev alloc failed",
__func__); __func__);
return NULL; return NULL;
} }
netdev->priv = c2dev; netdev->ml_priv = c2dev;
SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev); SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment