Re: [PATCH 3/3] Input: wacom_w8001 - use ACQUIRE() for interruptible mutex in w8001_open()

From: Jason Gerecke

Date: Tue Oct 13 2026 - 19:53:48 EST


On Fri, Oct 9, 2026 at 12:28 PM Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
>
> 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

Aside from the Assisted-by comment in Patch 1/3, this LGTM.

Reviewed-by: Jason Gerecke <jason.gerecke@xxxxxxxxx>

Jason (she/they)
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....


> 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
>
>