summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2024-08-18 03:17:10 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-03-25 07:14:24 +0300
commit8c187a4c1592c483e95fc14fb800272cb41395a4 (patch)
treeed2038a26244a494965f1d2566ff607c3e10586a
parent6e9b9192d69d5d206afc502a06569a1650e41ef0 (diff)
downloadlinux-8c187a4c1592c483e95fc14fb800272cb41395a4.tar.xz
Input: ektf2127 - use guard notation when acquiring mutex
Guard notation simplifies code. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/touchscreen/ektf2127.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
index 46a0611fac82..572a37d4e0aa 100644
--- a/drivers/input/touchscreen/ektf2127.c
+++ b/drivers/input/touchscreen/ektf2127.c
@@ -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;
}