Commit 5a1a8425 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty: xtensa/iss, setup the timer statically

Use DEFINE_TIMER and avoid runtime initialization of the serial_timer.

Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-xtensa@linux-xtensa.org
Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210302062214.29627-32-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd5b2194
...@@ -31,21 +31,18 @@ ...@@ -31,21 +31,18 @@
#define SERIAL_MAX_NUM_LINES 1 #define SERIAL_MAX_NUM_LINES 1
#define SERIAL_TIMER_VALUE (HZ / 10) #define SERIAL_TIMER_VALUE (HZ / 10)
static void rs_poll(struct timer_list *);
static struct tty_driver *serial_driver; static struct tty_driver *serial_driver;
static struct tty_port serial_port; static struct tty_port serial_port;
static struct timer_list serial_timer; static DEFINE_TIMER(serial_timer, rs_poll);
static DEFINE_SPINLOCK(timer_lock); static DEFINE_SPINLOCK(timer_lock);
static void rs_poll(struct timer_list *);
static int rs_open(struct tty_struct *tty, struct file * filp) static int rs_open(struct tty_struct *tty, struct file * filp)
{ {
spin_lock_bh(&timer_lock); spin_lock_bh(&timer_lock);
if (tty->count == 1) { if (tty->count == 1)
timer_setup(&serial_timer, rs_poll, 0);
mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
}
spin_unlock_bh(&timer_lock); spin_unlock_bh(&timer_lock);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment