gpiod_export_link(9)
π gpiod_export_link(9) π
okay bestie, welcome to the Kernel API Manual β this is gpiod_export_link(9) and it is literally the social-media manager for GPIO sysfs nodes. It makes a cute little link so your device can find an exported GPIO without doing the most. π«Ά
β¨ SYNOPSIS β¨
int gpiod_export_link (struct device *dev , const char *name , struct
gpio_desc *desc );
π ARGUMENTS π
devβ the device under which to create the symlink. it's giving "where the link lives" energy.nameβ the name of the symlink. yes, you get to name it. main character choice fr fr.descβ the GPIO to create the symlink to, and it must be already exported. no cap, check that first.
πΈ DESCRIPTION πΈ
So what this does is set up a symlink from /sys/.../dev/name to the /sys/class/gpio/gpioN node. iconic behavior honestly. π₯
π important bestie: the caller is responsible for unlinking. this function does not clean up after itself, so don't just leave your link sitting there like an unread group chat. π
β RETURN β
0on success- negative
errnoon failure
that's it. slay. π
π¦ SEE ALSO π¦
- Kernel file
./drivers/gpio/gpiolib-sysfs.cβ and its bestiesgpiod_export(9),gpiod_unexport(9)
later, bestie β this page came from ./drivers/gpio, October 2026 πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms