summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sis/sis190.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-24 11:46:52 +0300
committerDavid S. Miller <davem@davemloft.net>2017-10-25 07:09:47 +0300
commitfd71e13bc7c6ac2d34f08380707662cf07f8234c (patch)
treeae19b1ad794c2fa243828cff560f5a809d4a7389 /drivers/net/ethernet/sis/sis190.c
parent5c658e19a7b53b6d712c3fb08bb88649d362db9f (diff)
downloadlinux-fd71e13bc7c6ac2d34f08380707662cf07f8234c.tar.xz
drivers/net: sis: Convert timers to use timer_setup()
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: Francois Romieu <romieu@fr.zoreil.com> Cc: Daniele Venzano <venza@brownhat.org> Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Daniele Venzano <venza@brownhat.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sis/sis190.c')
-rw-r--r--drivers/net/ethernet/sis/sis190.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c
index 445109bd6910..c2c50522b96d 100644
--- a/drivers/net/ethernet/sis/sis190.c
+++ b/drivers/net/ethernet/sis/sis190.c
@@ -1018,10 +1018,10 @@ out_unlock:
rtnl_unlock();
}
-static void sis190_phy_timer(unsigned long __opaque)
+static void sis190_phy_timer(struct timer_list *t)
{
- struct net_device *dev = (struct net_device *)__opaque;
- struct sis190_private *tp = netdev_priv(dev);
+ struct sis190_private *tp = from_timer(tp, t, timer);
+ struct net_device *dev = tp->dev;
if (likely(netif_running(dev)))
schedule_work(&tp->phy_task);
@@ -1039,10 +1039,8 @@ static inline void sis190_request_timer(struct net_device *dev)
struct sis190_private *tp = netdev_priv(dev);
struct timer_list *timer = &tp->timer;
- init_timer(timer);
+ timer_setup(timer, sis190_phy_timer, 0);
timer->expires = jiffies + SIS190_PHY_TIMEOUT;
- timer->data = (unsigned long)dev;
- timer->function = sis190_phy_timer;
add_timer(timer);
}