gpiolib: provide gpio_device_get_desc()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 27 Sep 2023 14:29:25 +0000 (16:29 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 4 Oct 2023 11:29:56 +0000 (13:29 +0200)
commit93548f8bbbbf5b62dbd37c8f61a037a06666787b
treec34338852cee00c40de2e10d8d1d41d306de374f
parentd62fcd9f1897d587f8f9db3f77ccae8797a44b5d
gpiolib: provide gpio_device_get_desc()

Getting the GPIO descriptor directly from the gpio_chip struct is
dangerous as we don't take the reference to the underlying GPIO device.
In order to start working towards removing gpiochip_get_desc(), let's
provide a safer variant that works with an existing reference to struct
gpio_device.

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