diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-03-02 07:22:02 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-10 09:34:08 +0100 |
commit | 5a1a8425c4436b7a7596a0cce7857bc058c6c360 (patch) | |
tree | 38a0d78391f889bb799d3ab7476b408525d41a19 /arch/xtensa/platforms/iss/console.c | |
parent | bd5b219425692f4a353d07f5b182e9c71bbcffc2 (diff) | |
download | linux-5a1a8425c4436b7a7596a0cce7857bc058c6c360.tar.gz linux-5a1a8425c4436b7a7596a0cce7857bc058c6c360.tar.bz2 linux-5a1a8425c4436b7a7596a0cce7857bc058c6c360.zip |
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: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210302062214.29627-32-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/xtensa/platforms/iss/console.c')
-rw-r--r-- | arch/xtensa/platforms/iss/console.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 3b89d9ceb06a..8ea261b8c022 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -31,21 +31,18 @@ #define SERIAL_MAX_NUM_LINES 1 #define SERIAL_TIMER_VALUE (HZ / 10) +static void rs_poll(struct timer_list *); + static struct tty_driver *serial_driver; 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 void rs_poll(struct timer_list *); - static int rs_open(struct tty_struct *tty, struct file * filp) { spin_lock_bh(&timer_lock); - if (tty->count == 1) { - timer_setup(&serial_timer, rs_poll, 0); + if (tty->count == 1) mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); - } spin_unlock_bh(&timer_lock); return 0; |