]> Git Repo - linux.git/commitdiff
tty: n_gsm: use DEFINE_SPINLOCK() for spinlock
authorGuobin Huang <[email protected]>
Tue, 6 Apr 2021 11:56:03 +0000 (19:56 +0800)
committerGreg Kroah-Hartman <[email protected]>
Wed, 7 Apr 2021 15:19:30 +0000 (17:19 +0200)
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <[email protected]>
Reviewed-by: Jiri Slaby <[email protected]>
Signed-off-by: Guobin Huang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/tty/n_gsm.c

index 9e12f9cb1a9832f43456871837dbf9ccd69300e6..d60cffc70a0cc2884c0c656311d6086b47563d12 100644 (file)
@@ -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);
This page took 0.048455 seconds and 4 git commands to generate.