aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/gpio
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-10-11 15:02:02 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-10-13 08:50:01 +0200
commit1559d14977b694570f010854b8192e6de034bc27 (patch)
treea42340abd3c23a1485fad6ad3ed881a7cfe435b1 /include/linux/gpio
parentgpio: hisi: Fix format specifier (diff)
downloadwireguard-linux-1559d14977b694570f010854b8192e6de034bc27.tar.xz
wireguard-linux-1559d14977b694570f010854b8192e6de034bc27.zip
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>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r--include/linux/gpio/driver.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index ae4162d3f1d3..0e40098aa283 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -619,6 +619,8 @@ void gpio_device_put(struct gpio_device *gdev);
DEFINE_FREE(gpio_device_put, struct gpio_device *,
if (IS_ERR_OR_NULL(_T)) gpio_device_put(_T));
+struct device *gpio_device_to_device(struct gpio_device *gdev);
+
bool gpiochip_line_is_irq(struct gpio_chip *gc, unsigned int offset);
int gpiochip_reqres_irq(struct gpio_chip *gc, unsigned int offset);
void gpiochip_relres_irq(struct gpio_chip *gc, unsigned int offset);