drivers: net: mlx4: use setup_timer() helper.
authorAllen Pais <allen.lkml@gmail.com>
Thu, 21 Sep 2017 17:05:04 +0000 (22:35 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Sep 2017 18:44:42 +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/mellanox/mlx4/catas.c

index 53daa6c..de0f9e5 100644 (file)
@@ -277,7 +277,7 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)
        phys_addr_t addr;
 
        INIT_LIST_HEAD(&priv->catas_err.list);
-       init_timer(&priv->catas_err.timer);
+       setup_timer(&priv->catas_err.timer, poll_catas, (unsigned long)dev);
        priv->catas_err.map = NULL;
 
        if (!mlx4_is_slave(dev)) {
@@ -293,8 +293,6 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)
                }
        }
 
-       priv->catas_err.timer.data     = (unsigned long) dev;
-       priv->catas_err.timer.function = poll_catas;
        priv->catas_err.timer.expires  =
                round_jiffies(jiffies + MLX4_CATAS_POLL_INTERVAL);
        add_timer(&priv->catas_err.timer);