netdev: ethernet dev_alloc_skb to netdev_alloc_skb
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet - Removed extra skb->dev = dev after netdev_alloc_skb Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
21a4e46995
commit
c056b734e5
@@ -589,7 +589,7 @@ static void irqrx_handler(struct net_device *dev)
|
||||
|
||||
/* fetch buffer */
|
||||
|
||||
skb = dev_alloc_skb(rda.length + 2);
|
||||
skb = netdev_alloc_skb(dev, rda.length + 2);
|
||||
if (skb == NULL)
|
||||
dev->stats.rx_dropped++;
|
||||
else {
|
||||
|
@@ -1934,11 +1934,10 @@ static void refill_rx(struct net_device *dev)
|
||||
int entry = np->dirty_rx % RX_RING_SIZE;
|
||||
if (np->rx_skbuff[entry] == NULL) {
|
||||
unsigned int buflen = np->rx_buf_sz+NATSEMI_PADDING;
|
||||
skb = dev_alloc_skb(buflen);
|
||||
skb = netdev_alloc_skb(dev, buflen);
|
||||
np->rx_skbuff[entry] = skb;
|
||||
if (skb == NULL)
|
||||
break; /* Better luck next round. */
|
||||
skb->dev = dev; /* Mark as being used by this device. */
|
||||
np->rx_dma[entry] = pci_map_single(np->pci_dev,
|
||||
skb->data, buflen, PCI_DMA_FROMDEVICE);
|
||||
np->rx_ring[entry].addr = cpu_to_le32(np->rx_dma[entry]);
|
||||
@@ -2344,7 +2343,7 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
|
||||
/* Check if the packet is long enough to accept
|
||||
* without copying to a minimally-sized skbuff. */
|
||||
if (pkt_len < rx_copybreak &&
|
||||
(skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) {
|
||||
(skb = netdev_alloc_skb(dev, pkt_len + RX_OFFSET)) != NULL) {
|
||||
/* 16 byte align the IP header */
|
||||
skb_reserve(skb, RX_OFFSET);
|
||||
pci_dma_sync_single_for_cpu(np->pci_dev,
|
||||
|
@@ -51,7 +51,7 @@ static int sonic_open(struct net_device *dev)
|
||||
printk("sonic_open: initializing sonic driver.\n");
|
||||
|
||||
for (i = 0; i < SONIC_NUM_RRS; i++) {
|
||||
struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2);
|
||||
struct sk_buff *skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2);
|
||||
if (skb == NULL) {
|
||||
while(i > 0) { /* free any that were allocated successfully */
|
||||
i--;
|
||||
@@ -422,7 +422,7 @@ static void sonic_rx(struct net_device *dev)
|
||||
status = sonic_rda_get(dev, entry, SONIC_RD_STATUS);
|
||||
if (status & SONIC_RCR_PRX) {
|
||||
/* Malloc up new buffer. */
|
||||
new_skb = dev_alloc_skb(SONIC_RBSIZE + 2);
|
||||
new_skb = netdev_alloc_skb(SONIC_RBSIZE + 2);
|
||||
if (new_skb == NULL) {
|
||||
printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
|
||||
lp->stats.rx_dropped++;
|
||||
|
Reference in New Issue
Block a user