gpiod_export_link(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 ⭐

  • 0 on success
  • negative errno on failure

that's it. slay. πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹


later, bestie β€” this page came from ./drivers/gpio, October 2026 πŸ’œβœ¨

πŸ“¦ where this page comes from