summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2024-08-18 03:08:28 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-03-25 07:14:21 +0300
commitb29be7bae37086fa04ffc52d6f1d761e5be811a3 (patch)
tree3c68a6d176c61cca7016f866e10da51d19e25e27
parent24b3bc4a8f1bf90d742de14b664845deba2e52ab (diff)
downloadlinux-b29be7bae37086fa04ffc52d6f1d761e5be811a3.tar.xz
Input: bu21029_ts - 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/bu21029_ts.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/bu21029_ts.c b/drivers/input/touchscreen/bu21029_ts.c
index 64f474e67312..68d9cd55ceeb 100644
--- a/drivers/input/touchscreen/bu21029_ts.c
+++ b/drivers/input/touchscreen/bu21029_ts.c
@@ -416,10 +416,10 @@ static int bu21029_suspend(struct device *dev)
struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
if (!device_may_wakeup(dev)) {
- mutex_lock(&bu21029->in_dev->mutex);
+ guard(mutex)(&bu21029->in_dev->mutex);
+
if (input_device_enabled(bu21029->in_dev))
bu21029_stop_chip(bu21029->in_dev);
- mutex_unlock(&bu21029->in_dev->mutex);
}
return 0;
@@ -431,10 +431,10 @@ static int bu21029_resume(struct device *dev)
struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
if (!device_may_wakeup(dev)) {
- mutex_lock(&bu21029->in_dev->mutex);
+ guard(mutex)(&bu21029->in_dev->mutex);
+
if (input_device_enabled(bu21029->in_dev))
bu21029_start_chip(bu21029->in_dev);
- mutex_unlock(&bu21029->in_dev->mutex);
}
return 0;