OMAP: DSS2: OMAPFB: Constify some function parameters
[safe/jmp/linux-2.6] / drivers / net / tulip / tulip_core.c
index 2a01f0e..0fa3140 100644 (file)
@@ -64,9 +64,9 @@ const char * const medianame[32] = {
 };
 
 /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
-#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
-       || defined(CONFIG_SPARC) || defined(__ia64__) \
-       || defined(__sh__) || defined(__mips__)
+#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) || \
+       defined(CONFIG_SPARC) || defined(__ia64__) || \
+       defined(__sh__) || defined(__mips__)
 static int rx_copybreak = 1518;
 #else
 static int rx_copybreak = 100;
@@ -449,8 +449,8 @@ media_picked:
                        iowrite32(0x0201B078, ioaddr + 0xB8);
                        next_tick = 1*HZ;
                }
-       } else if ((tp->chip_id == MX98713 || tp->chip_id == COMPEX9881)
-                          && ! tp->medialock) {
+       } else if ((tp->chip_id == MX98713 || tp->chip_id == COMPEX9881) &&
+                  ! tp->medialock) {
                dev->if_port = 0;
                tp->csr6 = 0x01880000 | (tp->full_duplex ? 0x0200 : 0);
                iowrite32(0x0f370000 | ioread16(ioaddr + 0x80), ioaddr + 0x80);
@@ -506,7 +506,7 @@ tulip_open(struct net_device *dev)
 
        tulip_init_ring (dev);
 
-       retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev);
+       retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev);
        if (retval)
                goto free_ring;
 
@@ -535,9 +535,9 @@ static void tulip_tx_timeout(struct net_device *dev)
                if (tulip_debug > 1)
                        printk(KERN_WARNING "%s: Transmit timeout using MII device.\n",
                                   dev->name);
-       } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142
-                          || tp->chip_id == MX98713 || tp->chip_id == COMPEX9881
-                          || tp->chip_id == DM910X) {
+       } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142 ||
+                  tp->chip_id == MX98713 || tp->chip_id == COMPEX9881 ||
+                  tp->chip_id == DM910X) {
                printk(KERN_WARNING "%s: 21140 transmit timed out, status %8.8x, "
                           "SIA %8.8x %8.8x %8.8x %8.8x, resetting...\n",
                           dev->name, ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12),
@@ -653,8 +653,9 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
        int entry;
        u32 flag;
        dma_addr_t mapping;
+       unsigned long flags;
 
-       spin_lock_irq(&tp->lock);
+       spin_lock_irqsave(&tp->lock, flags);
 
        /* Calculate the next Tx descriptor entry. */
        entry = tp->cur_tx % TX_RING_SIZE;
@@ -689,7 +690,7 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Trigger an immediate transmit demand. */
        iowrite32(0, tp->base_addr + CSR1);
 
-       spin_unlock_irq(&tp->lock);
+       spin_unlock_irqrestore(&tp->lock, flags);
 
        dev->trans_start = jiffies;
 
@@ -922,8 +923,6 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
                return 0;
 
        case SIOCSMIIREG:               /* Write MII PHY register. */
-               if (!capable (CAP_NET_ADMIN))
-                       return -EPERM;
                if (regnum & ~0x1f)
                        return -EINVAL;
                if (data->phy_id == phy) {
@@ -1539,8 +1538,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
                }
        }
        /* Lite-On boards have the address byte-swapped. */
-       if ((dev->dev_addr[0] == 0xA0  ||  dev->dev_addr[0] == 0xC0 || dev->dev_addr[0] == 0x02)
-               &&  dev->dev_addr[1] == 0x00)
+       if ((dev->dev_addr[0] == 0xA0 ||
+            dev->dev_addr[0] == 0xC0 ||
+            dev->dev_addr[0] == 0x02) &&
+           dev->dev_addr[1] == 0x00)
                for (i = 0; i < 6; i+=2) {
                        char tmp = dev->dev_addr[i];
                        dev->dev_addr[i] = dev->dev_addr[i+1];
@@ -1783,7 +1784,7 @@ static int tulip_resume(struct pci_dev *pdev)
                return retval;
        }
 
-       if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) {
+       if ((retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev))) {
                printk (KERN_ERR "tulip: request_irq failed in resume\n");
                return retval;
        }