diff options
author | Guobin Huang | 2021-04-06 19:56:03 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2021-04-07 17:19:30 +0200 |
commit | 399d44a1b13d6e83a01fa249fc12e1b69ae8e735 (patch) | |
tree | 75c53d86bb3c1a74b0388fa3ef22852412eaba7d /drivers | |
parent | 158e800e0fde91014812f5cdfb92ce812e3a33b4 (diff) |
tty: n_gsm: use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Guobin Huang <huangguobin4@huawei.com>
Link: https://lore.kernel.org/r/1617710163-48158-1-git-send-email-huangguobin4@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/n_gsm.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 9e12f9cb1a98..d60cffc70a0c 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -266,7 +266,7 @@ struct gsm_mux { #define MAX_MUX 4 /* 256 minors */ static struct gsm_mux *gsm_mux[MAX_MUX]; /* GSM muxes */ -static spinlock_t gsm_mux_lock; +static DEFINE_SPINLOCK(gsm_mux_lock); static struct tty_driver *gsm_tty_driver; @@ -3257,8 +3257,6 @@ static int __init gsm_init(void) gsm_tty_driver->init_termios.c_lflag &= ~ECHO; tty_set_operations(gsm_tty_driver, &gsmtty_ops); - spin_lock_init(&gsm_mux_lock); - if (tty_register_driver(gsm_tty_driver)) { put_tty_driver(gsm_tty_driver); tty_unregister_ldisc(N_GSM0710); |