mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
Input: ektf2127 - use guard notation when acquiring mutex
Guard notation simplifies code. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
6e9b9192d6
commit
8c187a4c15
|
|
@ -187,10 +187,10 @@ static int ektf2127_suspend(struct device *dev)
|
|||
{
|
||||
struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
|
||||
|
||||
mutex_lock(&ts->input->mutex);
|
||||
guard(mutex)(&ts->input->mutex);
|
||||
|
||||
if (input_device_enabled(ts->input))
|
||||
ektf2127_stop(ts->input);
|
||||
mutex_unlock(&ts->input->mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -199,10 +199,10 @@ static int ektf2127_resume(struct device *dev)
|
|||
{
|
||||
struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev));
|
||||
|
||||
mutex_lock(&ts->input->mutex);
|
||||
guard(mutex)(&ts->input->mutex);
|
||||
|
||||
if (input_device_enabled(ts->input))
|
||||
ektf2127_start(ts->input);
|
||||
mutex_unlock(&ts->input->mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user