]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/tokenring/3c359.c
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / drivers / net / tokenring / 3c359.c
index bf621328b6019e3a89bc21406ecaf4f8370218d9..43853e3b210e42977100f1c1b3828a3dfa9fe623 100644 (file)
@@ -296,8 +296,9 @@ static int __devinit xl_probe(struct pci_dev *pdev,
        } ; 
 
        /* 
-        * 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)) ; 
@@ -638,13 +639,13 @@ static int xl_open(struct net_device *dev)
        /* These MUST be on 8 byte boundaries */
        xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL);
        if (xl_priv->xl_tx_ring == NULL) {
-               printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
+               printk(KERN_WARNING "%s: Not enough memory to allocate tx buffers.\n",
                                     dev->name);
                free_irq(dev->irq,dev);
                return -ENOMEM;
        }
        xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL);
-       if (xl_priv->xl_tx_ring == NULL) {
+       if (xl_priv->xl_rx_ring == NULL) {
                printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
                                     dev->name);
                free_irq(dev->irq,dev);
@@ -669,6 +670,8 @@ static int xl_open(struct net_device *dev)
        if (i==0) { 
                printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers. Adapter disabled \n",dev->name) ; 
                free_irq(dev->irq,dev) ; 
+               kfree(xl_priv->xl_tx_ring);
+               kfree(xl_priv->xl_rx_ring);
                return -EIO ; 
        } 
 
@@ -974,7 +977,6 @@ static void xl_rx(struct net_device *dev)
 
                        netif_rx(skb2) ;                
                 } /* if multiple buffers */
-               dev->last_rx = jiffies ;        
        } /* while packet to do */
 
        /* Clear the updComplete interrupt */
@@ -1571,7 +1573,6 @@ static void xl_arb_cmd(struct net_device *dev)
                 * anyway.
                 */
 
-               dev->last_rx = jiffies ; 
                /* Acknowledge interrupt, this tells nic we are done with the arb */
                writel(ACK_INTERRUPT | ARBCACK | LATCH_ACK, xl_mmio + MMIO_COMMAND) ;