Skip to content

Commit

Permalink
Input: cm109 - spin_lock in complete() cleanup
Browse files Browse the repository at this point in the history
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Ming Lei authored and Dmitry Torokhov committed May 4, 2016
1 parent c90a0f0 commit d144cf4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/input/misc/cm109.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
struct cm109_dev *dev = urb->context;
const int status = urb->status;
int error;
unsigned long flags;

dev_dbg(&dev->intf->dev, "### URB IRQ: [0x%02x 0x%02x 0x%02x 0x%02x] keybit=0x%02x\n",
dev->irq_data->byte[0],
Expand Down Expand Up @@ -404,7 +405,7 @@ static void cm109_urb_irq_callback(struct urb *urb)

out:

spin_lock(&dev->ctl_submit_lock);
spin_lock_irqsave(&dev->ctl_submit_lock, flags);

dev->irq_urb_pending = 0;

Expand All @@ -428,14 +429,15 @@ static void cm109_urb_irq_callback(struct urb *urb)
__func__, error);
}

spin_unlock(&dev->ctl_submit_lock);
spin_unlock_irqrestore(&dev->ctl_submit_lock, flags);
}

static void cm109_urb_ctl_callback(struct urb *urb)
{
struct cm109_dev *dev = urb->context;
const int status = urb->status;
int error;
unsigned long flags;

dev_dbg(&dev->intf->dev, "### URB CTL: [0x%02x 0x%02x 0x%02x 0x%02x]\n",
dev->ctl_data->byte[0],
Expand All @@ -450,7 +452,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)
__func__, status);
}

spin_lock(&dev->ctl_submit_lock);
spin_lock_irqsave(&dev->ctl_submit_lock, flags);

dev->ctl_urb_pending = 0;

Expand All @@ -471,7 +473,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)
}
}

spin_unlock(&dev->ctl_submit_lock);
spin_unlock_irqrestore(&dev->ctl_submit_lock, flags);
}

static void cm109_toggle_buzzer_async(struct cm109_dev *dev)
Expand Down

0 comments on commit d144cf4

Please sign in to comment.