Bartosz Golaszewski 0d7fa0eda4 gpio: don't let lockdep complain about inherently dangerous RCU usage
There are two legacy, deprecated functions - gpiod_to_chip() and
gpio_device_get_chip() - that still have users in tree. They return the
address of the SRCU-protected chip outside of the read-only critical
sections. They are inherently dangerous and the users should convert to
safer alternatives. Let's explicitly silence lockdep warnings by using
rcu_dereference_check(ptr, 1). While at it: reuse
gpio_device_get_chip() in gpiod_to_chip().

Fixes: d83cee3d2bb1 ("gpio: protect the pointer to gpio_chip in gpio_device with SRCU")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202402122234.d85cca9b-lkp@intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-02-15 08:39:29 +01:00
..
2024-02-12 10:12:41 +01:00
2023-10-13 08:39:30 +02:00
2022-10-26 14:52:01 +02:00
2023-12-18 13:43:06 +01:00
2022-10-08 09:46:29 -07:00
2023-11-09 13:47:52 -08:00
2023-10-04 11:37:25 +02:00
2023-08-21 10:39:58 +02:00
2022-06-21 18:01:11 +03:00
2023-03-06 12:33:02 +02:00
2023-10-31 17:21:54 -10:00
2023-08-29 10:21:56 -07:00
2023-03-06 12:33:02 +02:00
2023-03-06 12:33:02 +02:00
2024-02-02 14:32:12 +01:00