Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: icom: Use DEFINE_SPINLOCK() for spinlock

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20201223141438.889-1-zhengyongjun3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zheng Yongjun and committed by
Greg Kroah-Hartman
01493ccb a6052609

+1 -3
+1 -3
drivers/tty/serial/icom.c
··· 118 118 static LIST_HEAD(icom_adapter_head); 119 119 120 120 /* spinlock for adapter initialization and changing adapter operations */ 121 - static spinlock_t icom_lock; 121 + static DEFINE_SPINLOCK(icom_lock); 122 122 123 123 #ifdef ICOM_TRACE 124 124 static inline void trace(struct icom_port *icom_port, char *trace_pt, ··· 1615 1615 static int __init icom_init(void) 1616 1616 { 1617 1617 int ret; 1618 - 1619 - spin_lock_init(&icom_lock); 1620 1618 1621 1619 ret = uart_register_driver(&icom_uart_driver); 1622 1620 if (ret)