linux-stable/include/linux/gpio
Bartosz Golaszewski ba3f1a346b gpiolib: provide gpio_device_find()
[ Upstream commit cfe102f633 ]

gpiochip_find() is wrong and its kernel doc is misleading as the
function doesn't return a reference to the gpio_chip but just a raw
pointer. The chip itself is not guaranteed to stay alive, in fact it can
be deleted at any point. Also: other than GPIO drivers themselves,
nobody else has any business accessing gpio_chip structs.

Provide a new gpio_device_find() function that returns a real reference
to the opaque gpio_device structure that is guaranteed to stay alive for
as long as there are active users of it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Stable-dep-of: 48e1b4d369 ("gpiolib: remove the GPIO device from the list when it's unregistered")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:39 -08:00
..
aspeed.h gpio: aspeed: Add missing header(s) 2022-10-19 17:03:55 +03:00
consumer.h gpiolib: Clean up headers 2023-03-06 12:33:02 +02:00
driver.h gpiolib: provide gpio_device_find() 2024-01-25 15:35:39 -08:00
gpio-reg.h gpio: reg: Add missing header(s) 2022-10-24 12:29:36 +03:00
legacy-of-mm-gpiochip.h gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h 2023-03-06 12:33:01 +02:00
machine.h gpiolib: Clean up headers 2022-10-24 12:30:26 +03:00
property.h gpiolib: add support for software nodes 2022-11-15 11:21:43 +01:00
regmap.h