]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/adaptec/starfire.c
Merge tag 'dlm-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
[~andy/linux] / drivers / net / ethernet / adaptec / starfire.c
index cb4f38a17f2006aa5fa4971c7a260d6d5957fff1..d896816512ca952f943b9bbe04e27686a0bab7fd 100644 (file)
@@ -686,10 +686,9 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
        }
 
        dev = alloc_etherdev(sizeof(*np));
-       if (!dev) {
-               printk(KERN_ERR DRV_NAME " %d: cannot alloc etherdev, aborting\n", card_idx);
+       if (!dev)
                return -ENOMEM;
-       }
+
        SET_NETDEV_DEV(dev, &pdev->dev);
 
        irq = pdev->irq;
@@ -1180,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);
        }
@@ -1473,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,
@@ -1597,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);
                }