usb_role_swi...nd_by_fwnode(9)
β¨ 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 πβ¨
usb_role_switch_set_role(9)usb_role_switch_get_role(9)usb_role_switch_get(9)fwnode_usb_role_switch_get(9)usb_role_switch_put(9)usb_role_switch_register(9)usb_role_switch_unregister(9)usb_role_switch_set_drvdata(9)usb_role_switch_get_drvdata(9)
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
- 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