linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] i2c: busses: Use DEFINE_SPINLOCK() for spinlock
@ 2020-12-28 13:51 Zheng Yongjun
  2021-01-05 16:44 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-28 13:51 UTC (permalink / raw)
  To: linux-i2c, linux-kernel; +Cc: Zheng Yongjun

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

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/i2c/busses/i2c-elektor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c
index 140426db28df..671f9ac8387e 100644
--- a/drivers/i2c/busses/i2c-elektor.c
+++ b/drivers/i2c/busses/i2c-elektor.c
@@ -49,7 +49,7 @@ static int mmapped;
 
 static wait_queue_head_t pcf_wait;
 static int pcf_pending;
-static spinlock_t lock;
+static DEFINE_SPINLOCK(lock);
 
 static struct i2c_adapter pcf_isa_ops;
 
@@ -132,7 +132,6 @@ static irqreturn_t pcf_isa_handler(int this_irq, void *dev_id) {
 
 static int pcf_isa_init(void)
 {
-	spin_lock_init(&lock);
 	if (!mmapped) {
 		if (!request_region(base, 2, pcf_isa_ops.name)) {
 			printk(KERN_ERR "%s: requested I/O region (%#x:2) is "
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] i2c: busses: Use DEFINE_SPINLOCK() for spinlock
  2020-12-28 13:51 [PATCH -next] i2c: busses: Use DEFINE_SPINLOCK() for spinlock Zheng Yongjun
@ 2021-01-05 16:44 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2021-01-05 16:44 UTC (permalink / raw)
  To: Zheng Yongjun; +Cc: linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

On Mon, Dec 28, 2020 at 09:51:20PM +0800, Zheng Yongjun wrote:
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-05 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 13:51 [PATCH -next] i2c: busses: Use DEFINE_SPINLOCK() for spinlock Zheng Yongjun
2021-01-05 16:44 ` Wolfram Sang

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).