gpiolib: extend the critical sections of lookup tables
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 20 Sep 2023 08:56:39 +0000 (10:56 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 2 Oct 2023 13:34:32 +0000 (15:34 +0200)
commitc31071eabb448c58e0c43d519932af42dfc8f07d
tree4736d815d0ab7825c5c04f84226d01682f738ac7
parentd9d5829d457f1fe72f42cc813008eb7a8f789c47
gpiolib: extend the critical sections of lookup tables

There are two places in the code where we retrieve a lookup table using
gpiod_find_lookup_table() (which protects the table list with the lookup
table lock) and then use it after the lock is released.

We need to keep the lookup table mutex locked the entire time we're using
the tables. Remove the locking from gpiod_find_lookup_table() and use
guards to protect the code actually using the table objects.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c