]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Input: ektf2127 - use guard notation when acquiring mutex
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 18 Aug 2024 00:17:10 +0000 (17:17 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 25 Mar 2026 04:14:24 +0000 (21:14 -0700)
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/ektf2127.c

index 46a0611fac8228bcd8ad6e2f9498835c83fb8227..572a37d4e0aa11302000aaa76895340bd5ee7937 100644 (file)
@@ -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;
 }