[PATCH 3/3] Input: wacom_w8001 - use ACQUIRE() for interruptible mutex in w8001_open()
From: Dmitry Torokhov
Date: Fri Oct 09 2026 - 15:21:49 EST
Switch from scoped_guard(mutex_intr, ...) with an error fallback of
-EINTR to ACQUIRE(mutex_intr, lock) and ACQUIRE_ERR(mutex_intr, &lock).
This flattens the function logic and propagates the exact return value
from mutex_lock_interruptible().
Assisted-by: LLM
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/input/touchscreen/wacom_w8001.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index e967f2413706..b34fcac44f63 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -387,18 +387,20 @@ static int w8001_open(struct input_dev *dev)
struct w8001 *w8001 = input_get_drvdata(dev);
int err;
- scoped_guard(mutex_intr, &w8001->mutex) {
- if (w8001->open_count == 0) {
- err = w8001_command(w8001, W8001_CMD_START, false);
- if (err)
- return err;
- }
+ ACQUIRE(mutex_intr, lock)(&w8001->mutex);
+ err = ACQUIRE_ERR(mutex_intr, &lock);
+ if (err)
+ return err;
- w8001->open_count++;
- return 0;
+ if (w8001->open_count == 0) {
+ err = w8001_command(w8001, W8001_CMD_START, false);
+ if (err)
+ return err;
}
- return -EINTR;
+ w8001->open_count++;
+
+ return 0;
}
static void w8001_close(struct input_dev *dev)
--
2.56.0.385.gd3acb90ef8-goog