diff mbox series

[-next] i2c: busses: Use DEFINE_SPINLOCK() for spinlock

Message ID 20201228135120.28678-1-zhengyongjun3@huawei.com
State Accepted
Headers show
Series [-next] i2c: busses: Use DEFINE_SPINLOCK() for spinlock | expand

Commit Message

Zheng Yongjun Dec. 28, 2020, 1:51 p.m. UTC
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(-)

Comments

Wolfram Sang Jan. 5, 2021, 4:44 p.m. UTC | #1
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!
diff mbox series

Patch

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 "