gpio: sim: add lockdep asserts
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 14 Feb 2024 10:45:06 +0000 (11:45 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 26 Feb 2024 15:43:51 +0000 (16:43 +0100)
commit11498d99008fbe6a23e827773d9ee47728f23aa6
treef4c51dfc73dada31c1f635a1cab69a6733727362
parentf837fe1bffe6976ed5e7198b1892ea248b75358b
gpio: sim: add lockdep asserts

We have three functions in gpio-sim that are called with the device lock
already held. We use the "_unlocked" suffix in their names to indicate
that. This has proven to be confusing though as the naming convention in
the kernel varies between using "_locked" or "_unlocked" for this
purpose. Naming convention also doesn't enforce anything. Let's remove
the suffix and add lockdep annotation at the top of these functions.

This makes it clear the function requires a lock to be held (and which
one specifically!) as well as results in a warning if it's not the case.
The only place where the information is lost is the place where the
function is called but the caller doesn't care about that information
anyway.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-sim.c