diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-12 03:52:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:30 -0500 |
commit | 40565f1962c5be9b9e285e05af01ab7771534868 (patch) | |
tree | ae84097778a8adfc5a9aad8a5428fe803d54346a /drivers/char/synclink.c | |
parent | d096f3e9898d469493fc0afe88d7285c4bdc3ce2 (diff) |
[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 <jirislaby@gmail.com>
Cc: Dave Airlie <airlied@linux.ie>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Dmitry Torokhov <dtor@mail.ru> (Input bits)
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/synclink.c')
-rw-r--r-- | drivers/char/synclink.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index bf76db1342c5..ce4db6f52362 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -1798,9 +1798,7 @@ static int startup(struct mgsl_struct * info) | |||
1798 | 1798 | ||
1799 | memset(&info->icount, 0, sizeof(info->icount)); | 1799 | memset(&info->icount, 0, sizeof(info->icount)); |
1800 | 1800 | ||
1801 | init_timer(&info->tx_timer); | 1801 | setup_timer(&info->tx_timer, mgsl_tx_timeout, (unsigned long)info); |
1802 | info->tx_timer.data = (unsigned long)info; | ||
1803 | info->tx_timer.function = mgsl_tx_timeout; | ||
1804 | 1802 | ||
1805 | /* Allocate and claim adapter resources */ | 1803 | /* Allocate and claim adapter resources */ |
1806 | retval = mgsl_claim_resources(info); | 1804 | retval = mgsl_claim_resources(info); |
@@ -1851,7 +1849,7 @@ static void shutdown(struct mgsl_struct * info) | |||
1851 | wake_up_interruptible(&info->status_event_wait_q); | 1849 | wake_up_interruptible(&info->status_event_wait_q); |
1852 | wake_up_interruptible(&info->event_wait_q); | 1850 | wake_up_interruptible(&info->event_wait_q); |
1853 | 1851 | ||
1854 | del_timer(&info->tx_timer); | 1852 | del_timer_sync(&info->tx_timer); |
1855 | 1853 | ||
1856 | if (info->xmit_buf) { | 1854 | if (info->xmit_buf) { |
1857 | free_page((unsigned long) info->xmit_buf); | 1855 | free_page((unsigned long) info->xmit_buf); |
@@ -5710,8 +5708,8 @@ static void usc_start_transmitter( struct mgsl_struct *info ) | |||
5710 | 5708 | ||
5711 | usc_TCmd( info, TCmd_SendFrame ); | 5709 | usc_TCmd( info, TCmd_SendFrame ); |
5712 | 5710 | ||
5713 | info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); | 5711 | mod_timer(&info->tx_timer, jiffies + |
5714 | add_timer(&info->tx_timer); | 5712 | msecs_to_jiffies(5000)); |
5715 | } | 5713 | } |
5716 | info->tx_active = 1; | 5714 | info->tx_active = 1; |
5717 | } | 5715 | } |