Skip to content

Commit 45c6c87

Browse files
Zheng Yongjunwsakernel
authored andcommitted
i2c: busses: Use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 9d64834 commit 45c6c87

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/i2c/busses/i2c-elektor.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static int mmapped;
4949

5050
static wait_queue_head_t pcf_wait;
5151
static int pcf_pending;
52-
static spinlock_t lock;
52+
static DEFINE_SPINLOCK(lock);
5353

5454
static struct i2c_adapter pcf_isa_ops;
5555

@@ -132,7 +132,6 @@ static irqreturn_t pcf_isa_handler(int this_irq, void *dev_id) {
132132

133133
static int pcf_isa_init(void)
134134
{
135-
spin_lock_init(&lock);
136135
if (!mmapped) {
137136
if (!request_region(base, 2, pcf_isa_ops.name)) {
138137
printk(KERN_ERR "%s: requested I/O region (%#x:2) is "

0 commit comments

Comments
 (0)