typec_altmode_get_plug(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– typec_altmode_get_plug(9) β€” the Kernel API Manual page, bestie edition πŸ’–

okay so this is a page from the Kernel API Manual (manual section 9, the kernel-functions one, iykyk) and it's all about typec_altmode_get_plug. literally the whole personality of this function is "find the cable plug alternate mode" and honestly? slay.


✨ NAME ✨

typec_altmode_get_plug β€” find the cable plug alternate mode πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct typec_altmode * typec_altmode_get_plug (struct typec_altmode
*adev , enum typec_plug_index index );

like yes that's the whole signature, no cap, it's giving "one function, two arguments, zero drama" πŸ’…


🌸 ARGUMENTS 🌸

  • adev β€” handle to the partner alternate mode. that's your entry point, bestie 🫢
  • index β€” the cable plug index. which plug we talking about? this tells it ✨

πŸ’œ DESCRIPTION πŸ’œ

so what this does: it increments the reference count for the cable plug alternate mode device. yes, the refcount. we love a responsible reference count πŸ’…

then it returns a handle to the cable plug alternate mode β€” or NULL if none is found. that's it! NULL means none, no vibes to be found, empty group chat 😭

ngl, always vibe check that return value before you dereference it. NULL is a real possible answer here, fr fr.

🌈 SEE ALSO 🌈

the kernel file ./drivers/usb/typec/bus.c lives over there and it's iconic, plus these besties:

not me listing all of them, but also... yes, all of them, periodt. go read the whole friend group 🌸


okay and one last cute sign-off πŸŽ€ β€” this page comes from ./drivers/usb/typec, and the version/date stamped on it is October 2026, and the title repping it at the bottom is typec_altmode_get_plug(9). that's the whole footer, bestie, we ate πŸ’–βœ¨

πŸ“¦ where this page comes from