usb_role_swi...nd_by_fwnode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

usb_role_switch_find_by_fwnode β€” bestie, this is the one that finds you a USB role switch using its fwnode πŸ’… (and yes, this is from the Kernel API Manual, so we're being ✨ official ✨ today)


🌸 SYNOPSIS 🌸

struct usb_role_switch * usb_role_switch_find_by_fwnode (const struct
fwnode_handle *fwnode );
ok so like, it hands you back a struct usb_role_switch * β€” noted πŸ‘‘

πŸŽ€ ARGUMENTS πŸŽ€

  • fwnode β€” the fwnode of the USB Role Switch πŸ’– like, the lil identity tag of the switch you're looking for, no cap

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: this function finds the role switch that goes with fwnode and returns it. Simple. Iconic. Main character energy fr fr 🌈

But the part you cannot skip: the reference count for the found switch is incremented. The way that matters β€” the switch you get back is holding a reference, so it's on you to deal with that properly later. Don't just ghost it 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/usb/roles/class.c β€” go read it, iykyk πŸ“–βœ¨


okayyy that's the whole page, mwah πŸ’‹ this little deliverable came from ./drivers/usb/roles, dated October 2026, and it's literally titled usb_role_swi...nd_by_fwnode(9) in case you forgot already πŸ™ˆ slay, go increment some reference counts responsibly bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from