netdevice: Kill netdev->priv
This is the last shoot of this series.
After I removing all directly reference of netdev->priv, I am killing
"priv" of "struct net_device" and fixing relative comments/docs.
Anyone will not be allowed to reference netdev->priv directly.
If you want to reference the memory of private data, use netdev_priv()
instead.
If the private data is not allocted when alloc_netdev(), use
netdev->ml_priv to point that memory after you creating that private
data.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/3c501.h b/drivers/net/3c501.h
index cfec64e..f40b049 100644
--- a/drivers/net/3c501.h
+++ b/drivers/net/3c501.h
@@ -23,7 +23,7 @@
static int el_debug = EL_DEBUG;
/*
- * Board-specific info in dev->priv.
+ * Board-specific info in netdev_priv(dev).
*/
struct net_local
diff --git a/drivers/net/atp.c b/drivers/net/atp.c
index 7028b27..1d6b74c5 100644
--- a/drivers/net/atp.c
+++ b/drivers/net/atp.c
@@ -420,7 +420,7 @@
registers that "should" only need to be set once at boot, so that
there is non-reboot way to recover if something goes wrong.
- This is an attachable device: if there is no dev->priv entry then it wasn't
+ This is an attachable device: if there is no private entry then it wasn't
probed for at boot-time, and we need to probe for it again.
*/
static int net_open(struct net_device *dev)
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c
index a125e41..9ff3f2f 100644
--- a/drivers/net/eexpress.c
+++ b/drivers/net/eexpress.c
@@ -1046,7 +1046,7 @@
/*
* Sanity check the suspected EtherExpress card
* Read hardware address, reset card, size memory and initialize buffer
- * memory pointers. These are held in dev->priv, in case someone has more
+ * memory pointers. These are held in netdev_priv(), in case someone has more
* than one card in a machine.
*/
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 12384df..1f2b247 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -712,12 +712,12 @@
/*
* SMP locking:
- * All hardware access under dev->priv->lock, except the performance
+ * All hardware access under netdev_priv(dev)->lock, except the performance
* critical parts:
* - rx is (pseudo-) lockless: it relies on the single-threading provided
* by the arch code for interrupts.
* - tx setup is lockless: it relies on netif_tx_lock. Actual submission
- * needs dev->priv->lock :-(
+ * needs netdev_priv(dev)->lock :-(
* - set_multicast_list: preparation lockless, relies on netif_tx_lock.
*/
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index e81b611..d7afb93 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -519,7 +519,7 @@
}
}
- /* We can't allocate dev->priv from alloc_etherdev() because it must
+ /* We can't allocate private data from alloc_etherdev() because it must
a ISA DMA-able region. */
chipname = chip_table[lance_version].name;
printk("%s: %s at %#3x, ", dev->name, chipname, ioaddr);
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index 6833f65..899ed06 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -1091,7 +1091,7 @@
err_free_irq:
free_irq(dev->irq, dev);
err:
- /* This will also free the co-allocated 'dev->priv' */
+ /* This will also free the co-allocated private data*/
free_netdev(dev);
return -ENODEV;
}
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index b23b5c3..c95fd72 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -781,7 +781,7 @@
dev->irq = pdev->irq;
dev->base_addr = (unsigned long) ioaddr;
- /* dev->priv/tp zeroed and aligned in alloc_etherdev */
+ /* netdev_priv()/tp zeroed and aligned in alloc_etherdev */
tp = netdev_priv(dev);
/* note: tp->chipset set in netdrv_init_board */
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c
index e8f97d5..e0d8477 100644
--- a/drivers/net/sun3_82586.c
+++ b/drivers/net/sun3_82586.c
@@ -209,7 +209,7 @@
static int check586(struct net_device *dev,char *where,unsigned size)
{
struct priv pb;
- struct priv *p = /* (struct priv *) dev->priv*/ &pb;
+ struct priv *p = &pb;
char *iscp_addr;
int i;
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 977b3e0..7f69c7f 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -1233,7 +1233,7 @@
bp->bmac_block,
bp->bblock_dvma);
- /* This also frees the co-located 'dev->priv' */
+ /* This also frees the co-located private data */
free_netdev(dev);
return -ENODEV;
}
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index e7a9446..43853e3 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -296,8 +296,9 @@
} ;
/*
- * Allowing init_trdev to allocate the dev->priv structure will align xl_private
- * on a 32 bytes boundary which we need for the rx/tx descriptors
+ * Allowing init_trdev to allocate the private data will align
+ * xl_private on a 32 bytes boundary which we need for the rx/tx
+ * descriptors
*/
dev = alloc_trdev(sizeof(struct xl_private)) ;
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 93b74b7..8d405c8 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -191,12 +191,13 @@
The driver runs as two independent, single-threaded flows of control. One
is the send-packet routine, which enforces single-threaded use by the
-dev->priv->lock spinlock. The other thread is the interrupt handler, which
-is single threaded by the hardware and interrupt handling software.
+netdev_priv(dev)->lock spinlock. The other thread is the interrupt handler,
+which is single threaded by the hardware and interrupt handling software.
The send packet thread has partial control over the Tx ring. It locks the
-dev->priv->lock whenever it's queuing a Tx packet. If the next slot in the ring
-is not available it stops the transmit queue by calling netif_stop_queue.
+netdev_priv(dev)->lock whenever it's queuing a Tx packet. If the next slot in
+the ring is not available it stops the transmit queue by
+calling netif_stop_queue.
The interrupt handler has exclusive control over the Rx ring and records stats
from the Tx ring. After reaping the stats, it marks the Tx queue entry as
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 692e6c5..dd0de3a 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -2494,7 +2494,7 @@
dev->type = ARPHRD_METRICOM; /* dtang */
dev->hard_header_len = sizeof(STRIP_Header);
/*
- * dev->priv Already holds a pointer to our struct strip
+ * netdev_priv(dev) Already holds a pointer to our struct strip
*/
*(MetricomAddress *) & dev->broadcast = broadcast_address;