gpio: of: assign and read the hog pointer atomically
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 5 Jan 2024 12:12:45 +0000 (13:12 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 12 Feb 2024 09:50:24 +0000 (10:50 +0100)
commit8ce6fd81a452d554889874e50cd34e92cf4547d6
treed9c67f4a4f4f6471450bc7777cb26ad722926547
parente348544f7994d252427ed3ae637c7081cbb90f66
gpio: of: assign and read the hog pointer atomically

The device nodes representing GPIO hogs cannot be deleted without
unregistering the GPIO chip so there's no need to serialize their access.
However we must ensure that users can get the right address so write and
read it atomically.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpiolib-of.c
drivers/gpio/gpiolib.c