Skip to content

Commit

Permalink
i2c: busses: 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 <zhengyongjun3@huawei.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
Zheng Yongjun authored and wsakernel committed Jan 5, 2021
1 parent 9d64834 commit 45c6c87
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-elektor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 "
Expand Down

0 comments on commit 45c6c87

Please sign in to comment.