Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / net / core / link_watch.c
index 0f37266411b507a208c3f4dcd80240445cbc37d2..8b45c9d3b2490ce22bfdffd522dd5530439e8ca3 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/if.h>
@@ -35,8 +34,8 @@ enum lw_bits {
 static unsigned long linkwatch_flags;
 static unsigned long linkwatch_nextevent;
 
-static void linkwatch_event(void *dummy);
-static DECLARE_WORK(linkwatch_work, linkwatch_event, NULL);
+static void linkwatch_event(struct work_struct *dummy);
+static DECLARE_DELAYED_WORK(linkwatch_work, linkwatch_event);
 
 static LIST_HEAD(lweventlist);
 static DEFINE_SPINLOCK(lweventlist_lock);
@@ -125,16 +124,16 @@ void linkwatch_run_queue(void)
 
                dev_put(dev);
        }
-}       
+}
 
 
-static void linkwatch_event(void *dummy)
+static void linkwatch_event(struct work_struct *dummy)
 {
        /* Limit the number of linkwatch events to one
         * per second so that a runaway driver does not
         * cause a storm of messages on the netlink
         * socket
-        */     
+        */
        linkwatch_nextevent = jiffies + HZ;
        clear_bit(LW_RUNNING, &linkwatch_flags);
 
@@ -172,10 +171,9 @@ void linkwatch_fire_event(struct net_device *dev)
                        unsigned long delay = linkwatch_nextevent - jiffies;
 
                        /* If we wrap around we'll delay it by at most HZ. */
-                       if (!delay || delay > HZ)
-                               schedule_work(&linkwatch_work);
-                       else
-                               schedule_delayed_work(&linkwatch_work, delay);
+                       if (delay > HZ)
+                               delay = 0;
+                       schedule_delayed_work(&linkwatch_work, delay);
                }
        }
 }