]> Git Repo - linux.git/commitdiff
fpga: Use DEFINE_SPINLOCK() for spinlock
authorZheng Yongjun <[email protected]>
Mon, 28 Dec 2020 13:51:35 +0000 (21:51 +0800)
committerMoritz Fischer <[email protected]>
Sun, 10 Jan 2021 18:57:13 +0000 (10:57 -0800)
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun <[email protected]>
Reviewed-by: Tom Rix <[email protected]>
Signed-off-by: Moritz Fischer <[email protected]>
drivers/fpga/fpga-bridge.c

index 2deccacc3aa759ad8dc3761d404a38cceb1034e0..e9266b2a357f6029cd63f0edf8ea6722eb1649cd 100644 (file)
@@ -17,7 +17,7 @@ static DEFINE_IDA(fpga_bridge_ida);
 static struct class *fpga_bridge_class;
 
 /* Lock for adding/removing bridges to linked lists*/
-static spinlock_t bridge_list_lock;
+static DEFINE_SPINLOCK(bridge_list_lock);
 
 /**
  * fpga_bridge_enable - Enable transactions on the bridge
@@ -479,8 +479,6 @@ static void fpga_bridge_dev_release(struct device *dev)
 
 static int __init fpga_bridge_dev_init(void)
 {
-       spin_lock_init(&bridge_list_lock);
-
        fpga_bridge_class = class_create(THIS_MODULE, "fpga_bridge");
        if (IS_ERR(fpga_bridge_class))
                return PTR_ERR(fpga_bridge_class);
This page took 0.05894 seconds and 4 git commands to generate.