[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 <[email protected]>
Cc: Dave Airlie <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Dominik Brodowski <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Paul Fulghum <[email protected]>
Cc: Kylene Jo Hall <[email protected]>
Cc: Wim Van Sebroeck <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]> (Input bits)
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index fab1b7d..65f2d3a 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -1005,9 +1005,7 @@
tty->disc_data = pInfo;
tty->receive_room = 65536;
- init_timer(&pInfo->tmr);
- pInfo->tmr.data = (unsigned long)pInfo;
- pInfo->tmr.function = on_timeout;
+ setup_timer(&pInfo->tmr, on_timeout, (unsigned long)pInfo);
return 0;
}