From 40565f1962c5be9b9e285e05af01ab7771534868 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 12 Feb 2007 00:52:31 -0800 Subject: [PATCH] Char: timers cleanup - Use timer macros to set function and data members and to modify expiration time. - Use DEFINE_TIMER for global timers and do not init them at run-time in these cases. - del_timer_sync is common in most cases -- we want to wait for timer function if it's still running. Signed-off-by: Jiri Slaby Cc: Dave Airlie Cc: David Woodhouse Cc: Dominik Brodowski Cc: Alessandro Zummo Cc: Paul Fulghum Cc: Kylene Jo Hall Cc: Wim Van Sebroeck Acked-by: Dmitry Torokhov (Input bits) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/synclink.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/char/synclink.c') diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index bf76db1342c..ce4db6f5236 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -1798,9 +1798,7 @@ static int startup(struct mgsl_struct * info) memset(&info->icount, 0, sizeof(info->icount)); - init_timer(&info->tx_timer); - info->tx_timer.data = (unsigned long)info; - info->tx_timer.function = mgsl_tx_timeout; + setup_timer(&info->tx_timer, mgsl_tx_timeout, (unsigned long)info); /* Allocate and claim adapter resources */ retval = mgsl_claim_resources(info); @@ -1851,7 +1849,7 @@ static void shutdown(struct mgsl_struct * info) wake_up_interruptible(&info->status_event_wait_q); wake_up_interruptible(&info->event_wait_q); - del_timer(&info->tx_timer); + del_timer_sync(&info->tx_timer); if (info->xmit_buf) { free_page((unsigned long) info->xmit_buf); @@ -5710,8 +5708,8 @@ static void usc_start_transmitter( struct mgsl_struct *info ) usc_TCmd( info, TCmd_SendFrame ); - info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); - add_timer(&info->tx_timer); + mod_timer(&info->tx_timer, jiffies + + msecs_to_jiffies(5000)); } info->tx_active = 1; } -- cgit v1.2.3