Skip to content
Commit 6409d049 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpiolib: don't call sleeping functions with a spinlock taken



We must not call pinctrl_gpio_can_use_line() with the gpio_lock taken
as it takes a mutex internally. Let's move the call before taking the
spinlock and store the return value.

This isn't perfect - there's a moment between calling
pinctrl_gpio_can_use_line() and taking the spinlock where the situation
can change but it isn't a regression either: previously this part wasn't
protected at all and it only affects the information user-space is
seeing.

Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Fixes: d2ac2579 ("gpiolib: provide a dedicated function for setting lineinfo")
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4e154159
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment