usb_of_get_device_node(9)
π usb_of_get_device_node β like, the Kernel API Manual page, but make it make sense β¨
okay so bestie, welcome to the Kernel API Manual π β this is the page for usb_of_get_device_node(9), and honestly? it's a little function with a big job: finding the device tree node that belongs to a USB device. let's get into it π¦
β¨ NAME β¨
usb_of_get_device_node β get a USB device node π
like, it gets the node. the device node. for a USB device. that's the whole vibe π
πΈ SYNOPSIS πΈ
struct device_node * usb_of_get_device_node (struct usb_device *hub ,
int port1 );
that's the signature, copy it exactly, don't come for me π β it takes a hub and a port1 and hands you back a struct device_node *.
π«Ά ARGUMENTS π«Ά
hubβ the hub to which the device is connected. yes, the parent hub, like the main character that the device is attached to πport1β the one-based index of the port. one-based, bestie, not zero-based β so port 1 is the first port, not the second. iykyk π
π DESCRIPTION π
okay so here's the tea β β this function looks up the node of a USB device, and it does it given two things: its parent hub device, and the one-based port number it lives on.
that's it. that's the whole description. no cap, it's that simple π₯
β RETURN β
so what do you actually get back? π
- if it finds the node β a pointer to the node, with the refcount incremented β¨ (incremented refcount, meaning you're now holding a reference, so handle it responsibly, bestie π«Ά)
- otherwise β
NULLπ
π¦ SEE ALSO π¦
- the kernel file
./drivers/usb/core/of.cπ β that's where the magic lives usb_of_has_combined_node(9)usb_of_get_connect_type(9)usb_of_get_interface_node(9)
go read those too, they're giving sibling energy π
that's the whole page, periodt. π
this cutie lives in ./drivers/usb/core and the date on it is October 2026 β so yeah, mark your calendar, girlies ποΈπ slay, go find some device nodes, and remember: incremented refcount means you have to deal with it πΈπ§ββοΈ
π¦ 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