bonding: fix potential deadlock in bond_uninit()
[safe/jmp/linux-2.6] / drivers / net / smc91x.c
index ae4983a..fc1b5a1 100644 (file)
@@ -534,9 +534,9 @@ static inline void  smc_rcv(struct net_device *dev)
 #define smc_special_lock(lock, flags)          spin_lock_irqsave(lock, flags)
 #define smc_special_unlock(lock, flags)        spin_unlock_irqrestore(lock, flags)
 #else
-#define smc_special_trylock(lock, flags)       (1)
-#define smc_special_lock(lock, flags)          do { } while (0)
-#define smc_special_unlock(lock, flags)        do { } while (0)
+#define smc_special_trylock(lock, flags)       (flags == flags)
+#define smc_special_lock(lock, flags)          do { flags = 0; } while (0)
+#define smc_special_unlock(lock, flags)        do { flags = 0; } while (0)
 #endif
 
 /*
@@ -1395,7 +1395,7 @@ static void smc_set_multicast_list(struct net_device *dev)
         * I don't need to zero the multicast table, because the flag is
         * checked before the table is
         */
-       else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) {
+       else if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) > 16) {
                DBG(2, "%s: RCR_ALMUL\n", dev->name);
                lp->rcr_cur_mode |= RCR_ALMUL;
        }
@@ -1412,8 +1412,7 @@ static void smc_set_multicast_list(struct net_device *dev)
         * the number of the 8 bit register, while the low 3 bits are the bit
         * within that register.
         */
-       else if (dev->mc_count)  {
-               int i;
+       else if (!netdev_mc_empty(dev)) {
                struct dev_mc_list *cur_addr;
 
                /* table for flipping the order of 3 bits */
@@ -1422,13 +1421,9 @@ static void smc_set_multicast_list(struct net_device *dev)
                /* start with a table of all zeros: reject all */
                memset(multicast_table, 0, sizeof(multicast_table));
 
-               cur_addr = dev->mc_list;
-               for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) {
+               netdev_for_each_mc_addr(cur_addr, dev) {
                        int position;
 
-                       /* do we have a pointer here? */
-                       if (!cur_addr)
-                               break;
                        /* make sure this is a multicast address -
                           shouldn't this be a given if we have it here ? */
                        if (!(*cur_addr->dmi_addr & 1))
@@ -2387,7 +2382,7 @@ static int smc_drv_resume(struct device *dev)
 
        if (ndev) {
                struct smc_local *lp = netdev_priv(ndev);
-               smc_enable_device(dev);
+               smc_enable_device(pdev);
                if (netif_running(ndev)) {
                        smc_reset(ndev);
                        smc_enable(ndev);