]> Pileus Git - ~andy/linux/blobdiff - drivers/net/8139too.c
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
[~andy/linux] / drivers / net / 8139too.c
index 5e9ef52a5ca93b6852ed740333c3bea15d9e9958..e4f4eaff76792292abe07865d7fcdbae34ac59de 100644 (file)
@@ -768,8 +768,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
        /* dev and priv zeroed in alloc_etherdev */
        dev = alloc_etherdev (sizeof (*tp));
        if (dev == NULL) {
-               dev_printk (KERN_ERR, &pdev->dev,
-                           "Unable to alloc new net device\n");
+               dev_err(&pdev->dev, "Unable to alloc new net device\n");
                return -ENOMEM;
        }
        SET_MODULE_OWNER(dev);
@@ -801,29 +800,25 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
 #ifdef USE_IO_OPS
        /* make sure PCI base addr 0 is PIO */
        if (!(pio_flags & IORESOURCE_IO)) {
-               dev_printk (KERN_ERR, &pdev->dev,
-                           "region #0 not a PIO resource, aborting\n");
+               dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
                rc = -ENODEV;
                goto err_out;
        }
        /* check for weird/broken PCI region reporting */
        if (pio_len < RTL_MIN_IO_SIZE) {
-               dev_printk (KERN_ERR, &pdev->dev,
-                           "Invalid PCI I/O region size(s), aborting\n");
+               dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
                rc = -ENODEV;
                goto err_out;
        }
 #else
        /* make sure PCI base addr 1 is MMIO */
        if (!(mmio_flags & IORESOURCE_MEM)) {
-               dev_printk (KERN_ERR, &pdev->dev,
-                           "region #1 not an MMIO resource, aborting\n");
+               dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
                rc = -ENODEV;
                goto err_out;
        }
        if (mmio_len < RTL_MIN_IO_SIZE) {
-               dev_printk (KERN_ERR, &pdev->dev,
-                           "Invalid PCI mem region size(s), aborting\n");
+               dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
                rc = -ENODEV;
                goto err_out;
        }
@@ -840,7 +835,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
 #ifdef USE_IO_OPS
        ioaddr = ioport_map(pio_start, pio_len);
        if (!ioaddr) {
-               dev_printk (KERN_ERR, &pdev->dev, "cannot map PIO, aborting\n");
+               dev_err(&pdev->dev, "cannot map PIO, aborting\n");
                rc = -EIO;
                goto err_out;
        }
@@ -851,8 +846,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
        /* ioremap MMIO region */
        ioaddr = pci_iomap(pdev, 1, 0);
        if (ioaddr == NULL) {
-               dev_printk (KERN_ERR, &pdev->dev,
-                           "cannot remap MMIO, aborting\n");
+               dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
                rc = -EIO;
                goto err_out;
        }
@@ -866,8 +860,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
 
        /* check for missing/broken hardware */
        if (RTL_R32 (TxConfig) == 0xFFFFFFFF) {
-               dev_printk (KERN_ERR, &pdev->dev,
-                           "Chip not responding, ignoring board\n");
+               dev_err(&pdev->dev, "Chip not responding, ignoring board\n");
                rc = -EIO;
                goto err_out;
        }
@@ -961,10 +954,10 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
 
        if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
            pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) {
-               dev_printk(KERN_INFO, &pdev->dev,
+               dev_info(&pdev->dev,
                           "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
                           pdev->vendor, pdev->device, pci_rev);
-               dev_printk(KERN_INFO, &pdev->dev,
+               dev_info(&pdev->dev,
                           "Use the \"8139cp\" driver for improved performance and stability.\n");
        }
 
@@ -1716,6 +1709,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
        void __iomem *ioaddr = tp->mmio_addr;
        unsigned int entry;
        unsigned int len = skb->len;
+       unsigned long flags;
 
        /* Calculate the next Tx descriptor entry. */
        entry = tp->cur_tx % NUM_TX_DESC;
@@ -1732,7 +1726,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
                return 0;
        }
 
-       spin_lock_irq(&tp->lock);
+       spin_lock_irqsave(&tp->lock, flags);
        RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
                   tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
 
@@ -1743,7 +1737,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
        if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
                netif_stop_queue (dev);
-       spin_unlock_irq(&tp->lock);
+       spin_unlock_irqrestore(&tp->lock, flags);
 
        if (netif_msg_tx_queued(tp))
                printk (KERN_DEBUG "%s: Queued Tx packet size %u to slot %d.\n",