gpiolib: provide gpio_device_to_device()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 11 Oct 2023 13:02:02 +0000 (15:02 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 13 Oct 2023 06:50:01 +0000 (08:50 +0200)
commit1559d14977b694570f010854b8192e6de034bc27
treea42340abd3c23a1485fad6ad3ed881a7cfe435b1
parent4f3b436eea7d7242ca5c528fca1d2d15bc242190
gpiolib: provide gpio_device_to_device()

There are users in the kernel who need to retrieve the address of the
struct device backing the GPIO device. Currently they needlessly poke in
the internals of GPIOLIB. Add a dedicated getter function.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c
include/linux/gpio/driver.h