Skip to content

Commit

Permalink
fpga: Use DEFINE_SPINLOCK() for spinlock
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Zheng Yongjun authored and mfischer committed Jan 10, 2021
1 parent 5c8fe58 commit f518732
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/fpga/fpga-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f518732

Please sign in to comment.