gpiolib: provide gpio_device_get_label()

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmVg+XIACgkQEacuoBRx
 13KFzRAAhJlTX8JmIFaI4V0QNYD17IwVEW0VTemrVIxt/LCR5LxJ+W56su4D8yhD
 P+Uaj9ffWn9OCHFYWO4GjlOE7sqEeE4a3krpRsdZi1y7kfs4UFJN2s+kXuui7Juv
 RUx/tGAeTlqfveTpeewc5VSIwPqzEcLVc89zUy+yATm3+dQN8TEQWYnfjSn4D1i1
 LId4MsW3gf7IKsltpTTjY2O/askxdpqvP+rE3iJIjJER+4EEEDUCZEwb4M0G0Veg
 DCjpxGKUnWnKQnwoZE8FTVwEKgRI+RjB/sSSqNFNIaap7GLpDVw+C6MPC755GgGR
 WhyeNfCvLJJAHQx8GHtLVazLugvPSpb5OgNAvGa7WWxkGO7cwC8OC0ptM3mSbSns
 NY+T3faWPm7uml3Y3vRokjb+muLiEXltG5oIvTXGdDm0UGh+dej+A/039Kveu0eX
 LK4Zx3JSukdXHJKUetVoC1QTCTqf2AUDWHeswIkfkPTELRoARvBg0AS2IvtyLm9M
 pd84R/xLd9kdo4rC5kHYYUIBJbgoVWBEI+K1Bm2j0zKgEKLD/0P4qpejcTxXx9m8
 a4jOgdoCo5cQCDqKrQBvxfUdRNe/s41nFZBhHEYcPqM7kKsxGGGFkbuWwNWcZDtC
 wVHHlWJbEVR9HYS8liqg//DJprMhl/idt32KspuPvQus+TFOO10=
 =xTn3
 -----END PGP SIGNATURE-----

Merge tag 'gpio-device-get-label-for-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel

gpiolib: provide gpio_device_get_label()

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Linus Walleij 2023-11-25 00:27:25 +01:00
commit 16048722db
2 changed files with 15 additions and 0 deletions

View File

@ -254,6 +254,20 @@ int gpio_device_get_base(struct gpio_device *gdev)
}
EXPORT_SYMBOL_GPL(gpio_device_get_base);
/**
* gpio_device_get_label() - Get the label of this GPIO device
* @gdev: GPIO device
*
* Returns:
* Pointer to the string containing the GPIO device label. The string's
* lifetime is tied to that of the underlying GPIO device.
*/
const char *gpio_device_get_label(struct gpio_device *gdev)
{
return gdev->label;
}
EXPORT_SYMBOL(gpio_device_get_label);
/**
* gpio_device_get_chip() - Get the gpio_chip implementation of this GPIO device
* @gdev: GPIO device

View File

@ -786,6 +786,7 @@ struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc);
/* struct gpio_device getters */
int gpio_device_get_base(struct gpio_device *gdev);
const char *gpio_device_get_label(struct gpio_device *gdev);
#else /* CONFIG_GPIOLIB */