Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242557
b: refs/heads/master
c: a0fa220
h: refs/heads/master
i:
  242555: 9df6988
v: v3
  • Loading branch information
Aaro Koskinen authored and Dmitry Torokhov committed Mar 24, 2011
1 parent c88bd23 commit 456d995
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 903427955b9ffe1ca4b76c510089774c3b7a4a8a
refs/heads/master: a0fa2206f550066d6948d43c5401e973e5f7d320
12 changes: 10 additions & 2 deletions trunk/drivers/input/touchscreen/tsc2005.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,14 @@ static void tsc2005_esd_work(struct work_struct *work)
int error;
u16 r;

mutex_lock(&ts->mutex);
if (!mutex_trylock(&ts->mutex)) {
/*
* If the mutex is taken, it means that disable or enable is in
* progress. In that case just reschedule the work. If the work
* is not needed, it will be canceled by disable.
*/
goto reschedule;
}

if (time_is_after_jiffies(ts->last_valid_interrupt +
msecs_to_jiffies(ts->esd_timeout)))
Expand Down Expand Up @@ -510,11 +517,12 @@ static void tsc2005_esd_work(struct work_struct *work)
tsc2005_start_scan(ts);

out:
mutex_unlock(&ts->mutex);
reschedule:
/* re-arm the watchdog */
schedule_delayed_work(&ts->esd_work,
round_jiffies_relative(
msecs_to_jiffies(ts->esd_timeout)));
mutex_unlock(&ts->mutex);
}

static int tsc2005_open(struct input_dev *input)
Expand Down

0 comments on commit 456d995

Please sign in to comment.