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_gt.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_gt.c')
-rw-r--r-- | drivers/char/synclink_gt.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 54af763518fe..0a367cd4121f 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1825,8 +1825,7 @@ static void rx_async(struct slgt_info *info) | |||
1825 | if (i < count) { | 1825 | if (i < count) { |
1826 | /* receive buffer not completed */ | 1826 | /* receive buffer not completed */ |
1827 | info->rbuf_index += i; | 1827 | info->rbuf_index += i; |
1828 | info->rx_timer.expires = jiffies + 1; | 1828 | mod_timer(&info->rx_timer, jiffies + 1); |
1829 | add_timer(&info->rx_timer); | ||
1830 | break; | 1829 | break; |
1831 | } | 1830 | } |
1832 | 1831 | ||
@@ -3340,13 +3339,8 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev | |||
3340 | info->adapter_num = adapter_num; | 3339 | info->adapter_num = adapter_num; |
3341 | info->port_num = port_num; | 3340 | info->port_num = port_num; |
3342 | 3341 | ||
3343 | init_timer(&info->tx_timer); | 3342 | setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info); |
3344 | info->tx_timer.data = (unsigned long)info; | 3343 | setup_timer(&info->rx_timer, rx_timeout, (unsigned long)info); |
3345 | info->tx_timer.function = tx_timeout; | ||
3346 | |||
3347 | init_timer(&info->rx_timer); | ||
3348 | info->rx_timer.data = (unsigned long)info; | ||
3349 | info->rx_timer.function = rx_timeout; | ||
3350 | 3344 | ||
3351 | /* Copy configuration info to device instance data */ | 3345 | /* Copy configuration info to device instance data */ |
3352 | info->pdev = pdev; | 3346 | info->pdev = pdev; |
@@ -3794,10 +3788,9 @@ static void tx_start(struct slgt_info *info) | |||
3794 | } | 3788 | } |
3795 | } | 3789 | } |
3796 | 3790 | ||
3797 | if (info->params.mode == MGSL_MODE_HDLC) { | 3791 | if (info->params.mode == MGSL_MODE_HDLC) |
3798 | info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); | 3792 | mod_timer(&info->tx_timer, jiffies + |
3799 | add_timer(&info->tx_timer); | 3793 | msecs_to_jiffies(5000)); |
3800 | } | ||
3801 | } else { | 3794 | } else { |
3802 | tdma_reset(info); | 3795 | tdma_reset(info); |
3803 | /* set 1st descriptor address */ | 3796 | /* set 1st descriptor address */ |