gpiochip_dup_line_label(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gpiochip_dup_line_label(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: you're deep in gpio land (the kernel API manual kind of deep), and you just need a copy of the consumer label for one specific line. That's this function. She's little, she's useful, she hands you a string you now own and must free. Slay. ✨


✨ NAME ✨

gpiochip_dup_line_label β€” Get a copy of the consumer label.

πŸ¦‹ SYNOPSIS πŸ¦‹

char * gpiochip_dup_line_label (struct gpio_chip *gc , unsigned int
offset );

🌸 ARGUMENTS 🌸

  • gc β€” the GPIO chip controlling this line. like, the owner of the whole situation.
  • offset β€” the hardware offset of the line. which one we're looking at. πŸ‘‘

⭐ RETURN ⭐

Pointer to a copy of the consumer label if the line is requested, or NULL if it's not. 🫢

And listen β€” if a valid pointer came back, it must be freed using kfree. Not optional, not "eh I'll get to it". That's your pointer now, bestie, take care of it. πŸ’€

In case of a memory allocation error, the function returns ENOMEM.

πŸ’œ DESCRIPTION πŸ’œ

Must not be called from atomic context. fr fr. that's the whole description and it's giving boundaries. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

The kernel file ./drivers/gpio/gpiolib.c, plus literally the entire extended friend group:

like. the whole roster. iykyk πŸ’…


lowkey reminder bestie: not from atomic context, and kfree that pointer. that's the vibe check. πŸ“

and that's the page!! brought to you from ./drivers/gpio, dated October 2026, signed off by gpiochip_dup_line_label(9) herself β€” periodt. πŸ§šβ€β™€οΈπŸ’–πŸŒˆβ­πŸ‘‘

πŸ“¦ where this page comes from