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
3238a9be4d
commit
1d26643054
@@ -1179,12 +1179,11 @@ static void init_ring(struct net_device *dev)
|
||||
|
||||
/* Fill in the Rx buffers. Handle allocation failure gracefully. */
|
||||
for (i = 0; i < RX_RING_SIZE; i++) {
|
||||
struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
|
||||
struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz);
|
||||
np->rx_info[i].skb = skb;
|
||||
if (skb == NULL)
|
||||
break;
|
||||
np->rx_info[i].mapping = pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
|
||||
skb->dev = dev; /* Mark as being used by this device. */
|
||||
/* Grrr, we cannot offset to correctly align the IP header. */
|
||||
np->rx_ring[i].rxaddr = cpu_to_dma(np->rx_info[i].mapping | RxDescValid);
|
||||
}
|
||||
@@ -1472,7 +1471,7 @@ static int __netdev_rx(struct net_device *dev, int *quota)
|
||||
/* 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 + 2)) != NULL) {
|
||||
(skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
|
||||
skb_reserve(skb, 2); /* 16 byte align the IP header */
|
||||
pci_dma_sync_single_for_cpu(np->pci_dev,
|
||||
np->rx_info[entry].mapping,
|
||||
@@ -1596,13 +1595,12 @@ static void refill_rx_ring(struct net_device *dev)
|
||||
for (; np->cur_rx - np->dirty_rx > 0; np->dirty_rx++) {
|
||||
entry = np->dirty_rx % RX_RING_SIZE;
|
||||
if (np->rx_info[entry].skb == NULL) {
|
||||
skb = dev_alloc_skb(np->rx_buf_sz);
|
||||
skb = netdev_alloc_skb(dev, np->rx_buf_sz);
|
||||
np->rx_info[entry].skb = skb;
|
||||
if (skb == NULL)
|
||||
break; /* Better luck next round. */
|
||||
np->rx_info[entry].mapping =
|
||||
pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
|
||||
skb->dev = dev; /* Mark as being used by this device. */
|
||||
np->rx_ring[entry].rxaddr =
|
||||
cpu_to_dma(np->rx_info[entry].mapping | RxDescValid);
|
||||
}
|
||||
|
Reference in New Issue
Block a user