gpiolib: replace the GPIO device mutex with a read-write semaphore
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 2 Jan 2024 15:59:48 +0000 (16:59 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 4 Jan 2024 09:29:16 +0000 (10:29 +0100)
commit1979a28075470ef82472a5656ecc969f901e0d3b
tree12b01c23e316fe05b646bad05b66d5e03127789a
parent48e1b4d369cfe2729138a128afa6b8a55d093eaf
gpiolib: replace the GPIO device mutex with a read-write semaphore

There are only two spots where we modify (add to or remove objects from)
the GPIO device list. Readers should be able to access it concurrently.
Replace the mutex with a read-write semaphore and adjust the locking
operations accordingly.

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