]> err.no Git - linux-2.6/commitdiff
atl1: use spin_trylock_irqsave()
authorIngo Molnar <mingo@elte.hu>
Wed, 1 Aug 2007 00:07:02 +0000 (19:07 -0500)
committerJeff Garzik <jeff@garzik.org>
Tue, 7 Aug 2007 21:18:32 +0000 (17:18 -0400)
use the simpler spin_trylock_irqsave() API to get the adapter lock.

[ this is also a fix for -rt where adapter->lock is a sleeping lock. ]

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/atl1/atl1_main.c

index 56f6389a300eb3c18a50b7b636cb9965118b49cb..3c1984ecf36ca7a0331748f5d488dbed8838149f 100644 (file)
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                }
        }
 
-       local_irq_save(flags);
-       if (!spin_trylock(&adapter->lock)) {
+       if (!spin_trylock_irqsave(&adapter->lock, flags)) {
                /* Can't get lock - tell upper layer to requeue */
-               local_irq_restore(flags);
                dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
                return NETDEV_TX_LOCKED;
        }