OSDN Git Service

drivers: net: stmmac: use setup_timer() helper.
authorAllen Pais <allen.lkml@gmail.com>
Thu, 21 Sep 2017 17:05:18 +0000 (22:35 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Sep 2017 18:44:44 +0000 (11:44 -0700)
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 1763e48..f41661a 100644 (file)
@@ -2217,10 +2217,8 @@ static void stmmac_init_tx_coalesce(struct stmmac_priv *priv)
 {
        priv->tx_coal_frames = STMMAC_TX_FRAMES;
        priv->tx_coal_timer = STMMAC_COAL_TX_TIMER;
-       init_timer(&priv->txtimer);
+       setup_timer(&priv->txtimer, stmmac_tx_timer, (unsigned long)priv);
        priv->txtimer.expires = STMMAC_COAL_TIMER(priv->tx_coal_timer);
-       priv->txtimer.data = (unsigned long)priv;
-       priv->txtimer.function = stmmac_tx_timer;
        add_timer(&priv->txtimer);
 }