Input: poller - convert locking to guard notation

Use guard() notation instead of explicitly acquiring and releasing
mutex to simplify the code and ensure that it is released.

Link: https://lore.kernel.org/r/20241107071538.195340-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dmitry Torokhov 2024-11-06 23:15:34 -08:00
parent 679d2d6ce5
commit eccc065f0a

View File

@ -162,7 +162,7 @@ static ssize_t input_dev_set_poll_interval(struct device *dev,
if (interval > poller->poll_interval_max)
return -EINVAL;
mutex_lock(&input->mutex);
guard(mutex)(&input->mutex);
poller->poll_interval = interval;
@ -172,8 +172,6 @@ static ssize_t input_dev_set_poll_interval(struct device *dev,
input_dev_poller_queue_work(poller);
}
mutex_unlock(&input->mutex);
return count;
}