Home
last modified time | relevance | path

Searched hist:ba3f1a34 (Results 1 – 2 of 2) sorted by relevance

/openbmc/linux/include/linux/gpio/
H A Ddriver.hba3f1a34 Wed Sep 27 09:29:23 CDT 2023 Bartosz Golaszewski <bartosz.golaszewski@linaro.org> gpiolib: provide gpio_device_find()

[ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]

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: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
Signed-off-by: Sasha Levin <sashal@kernel.org>
/openbmc/linux/drivers/gpio/
H A Dgpiolib.cba3f1a34 Wed Sep 27 09:29:23 CDT 2023 Bartosz Golaszewski <bartosz.golaszewski@linaro.org> gpiolib: provide gpio_device_find()

[ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]

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: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
Signed-off-by: Sasha Levin <sashal@kernel.org>