net: dsa: remove DSA link polling
authorNeil Armstrong <narmstrong@baylibre.com>
Mon, 7 Dec 2015 12:57:32 +0000 (13:57 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Dec 2015 21:35:49 +0000 (16:35 -0500)
Since no more DSA driver uses the polling callback, and since
the phylib handles the link detection, remove the link polling
work and timer code.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/dsa/dsa.c

index 3f23dd9d6a692455d93e88b0a15688874e57bad5..26a0e86e611e8d3e76f726a6805a31464bcd63c8 100644 (file)
@@ -116,13 +116,6 @@ struct dsa_switch_tree {
        s8                      cpu_switch;
        s8                      cpu_port;
 
-       /*
-        * Link state polling.
-        */
-       int                     link_poll_needed;
-       struct work_struct      link_poll_work;
-       struct timer_list       link_poll_timer;
-
        /*
         * Data for the individual switch chips.
         */
@@ -231,11 +224,6 @@ struct dsa_switch_driver {
        int     (*phy_write)(struct dsa_switch *ds, int port,
                             int regnum, u16 val);
 
-       /*
-        * Link state polling and IRQ handling.
-        */
-       void    (*poll_link)(struct dsa_switch *ds);
-
        /*
         * Link state adjustment (called from libphy)
         */
index b7448c8490ac446c95b4a3bf18bca21e1e43439f..0f41f71efac1c6f90f9c6db74ad44aa708ad09a8 100644 (file)
@@ -508,33 +508,6 @@ static int dsa_switch_resume(struct dsa_switch *ds)
 }
 #endif
 
-
-/* link polling *************************************************************/
-static void dsa_link_poll_work(struct work_struct *ugly)
-{
-       struct dsa_switch_tree *dst;
-       int i;
-
-       dst = container_of(ugly, struct dsa_switch_tree, link_poll_work);
-
-       for (i = 0; i < dst->pd->nr_chips; i++) {
-               struct dsa_switch *ds = dst->ds[i];
-
-               if (ds != NULL && ds->drv->poll_link != NULL)
-                       ds->drv->poll_link(ds);
-       }
-
-       mod_timer(&dst->link_poll_timer, round_jiffies(jiffies + HZ));
-}
-
-static void dsa_link_poll_timer(unsigned long _dst)
-{
-       struct dsa_switch_tree *dst = (void *)_dst;
-
-       schedule_work(&dst->link_poll_work);
-}
-
-
 /* platform driver init and cleanup *****************************************/
 static int dev_is_class(struct device *dev, void *class)
 {
@@ -877,8 +850,6 @@ static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
                }
 
                dst->ds[i] = ds;
-               if (ds->drv->poll_link != NULL)
-                       dst->link_poll_needed = 1;
 
                ++configured;
        }
@@ -897,15 +868,6 @@ static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
        wmb();
        dev->dsa_ptr = (void *)dst;
 
-       if (dst->link_poll_needed) {
-               INIT_WORK(&dst->link_poll_work, dsa_link_poll_work);
-               init_timer(&dst->link_poll_timer);
-               dst->link_poll_timer.data = (unsigned long)dst;
-               dst->link_poll_timer.function = dsa_link_poll_timer;
-               dst->link_poll_timer.expires = round_jiffies(jiffies + HZ);
-               add_timer(&dst->link_poll_timer);
-       }
-
        return 0;
 }
 
@@ -972,11 +934,6 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
 {
        int i;
 
-       if (dst->link_poll_needed)
-               del_timer_sync(&dst->link_poll_timer);
-
-       flush_work(&dst->link_poll_work);
-
        for (i = 0; i < dst->pd->nr_chips; i++) {
                struct dsa_switch *ds = dst->ds[i];