OSDN Git Service

net: wan: Use DEFINE_SPINLOCK() for spinlock
authorZheng Yongjun <zhengyongjun3@huawei.com>
Tue, 29 Dec 2020 13:49:18 +0000 (21:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jan 2021 23:43:41 +0000 (15:43 -0800)
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/ixp4xx_hss.c

index 7c5cf77..ecea09f 100644 (file)
@@ -323,7 +323,7 @@ struct desc {
 
 static int ports_open;
 static struct dma_pool *dma_pool;
-static spinlock_t npe_lock;
+static DEFINE_SPINLOCK(npe_lock);
 
 static const struct {
        int tx, txdone, rx, rxfree;
@@ -1402,8 +1402,6 @@ static int __init hss_init_module(void)
            (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS))
                return -ENODEV;
 
-       spin_lock_init(&npe_lock);
-
        return platform_driver_register(&ixp4xx_hss_driver);
 }