mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
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:
parent
679d2d6ce5
commit
eccc065f0a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user