drivers/net: nuvoton: Convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Wed, 25 Oct 2017 10:51:58 +0000 (03:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Oct 2017 03:09:15 +0000 (12:09 +0900)
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/nuvoton/w90p910_ether.c

index 4a67c55aa9f14ac61706562bc8c3908de63053df..052b3d2c07a1222b7f902477f30d8eef5a75ab22 100644 (file)
@@ -253,10 +253,10 @@ static void update_linkspeed(struct net_device *dev)
        netif_carrier_on(dev);
 }
 
-static void w90p910_check_link(unsigned long dev_id)
+static void w90p910_check_link(struct timer_list *t)
 {
-       struct net_device *dev = (struct net_device *) dev_id;
-       struct w90p910_ether *ether = netdev_priv(dev);
+       struct w90p910_ether *ether = from_timer(ether, t, check_timer);
+       struct net_device *dev = ether->mii.dev;
 
        update_linkspeed(dev);
        mod_timer(&ether->check_timer, jiffies + msecs_to_jiffies(1000));
@@ -957,8 +957,7 @@ static int w90p910_ether_setup(struct net_device *dev)
        ether->mii.mdio_read = w90p910_mdio_read;
        ether->mii.mdio_write = w90p910_mdio_write;
 
-       setup_timer(&ether->check_timer, w90p910_check_link,
-                                               (unsigned long)dev);
+       timer_setup(&ether->check_timer, w90p910_check_link, 0);
 
        return 0;
 }