Commit f951e942 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 5bb6e29a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;
}