From: Zheng Yongjun <zhengyongjun3@huawei.com> To: <mdf@kernel.org>, <linux-fpga@vger.kernel.org>, <linux-kernel@vger.kernel.org> Cc: <trix@redhat.com>, Zheng Yongjun <zhengyongjun3@huawei.com> Subject: [PATCH -next] fpga: Use DEFINE_SPINLOCK() for spinlock Date: Mon, 28 Dec 2020 21:51:35 +0800 [thread overview] Message-ID: <20201228135135.28788-1-zhengyongjun3@huawei.com> (raw) spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> --- drivers/fpga/fpga-bridge.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index 2deccacc3aa7..e9266b2a357f 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -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); -- 2.22.0
next reply other threads:[~2020-12-28 13:51 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-28 13:51 Zheng Yongjun [this message] 2021-01-09 22:08 ` Tom Rix 2021-01-10 19:07 ` Moritz Fischer
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201228135135.28788-1-zhengyongjun3@huawei.com \ --to=zhengyongjun3@huawei.com \ --cc=linux-fpga@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mdf@kernel.org \ --cc=trix@redhat.com \ --subject='Re: [PATCH -next] fpga: Use DEFINE_SPINLOCK() for spinlock' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).