usb_create_hcd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– usb_create_hcd πŸ’–

okay bestie, welcome to the usb_create_hcd page from the Kernel API Manual ✨ this one is all about making an HCD and getting it set up, and yes it's giving kernel-core main character energy πŸ‘‘

✨ NAME ✨

usb_create_hcd β€” create and initialize an HCD structure. That's the whole assignment, bestie: make the HCD, initialize it, slay πŸ’…

πŸ› οΈ SYNOPSIS πŸ› οΈ

here's the exact signature, character for character, no cap:

struct usb_hcd * usb_create_hcd (const struct hc_driver *driver , struct device *dev , const char *bus_name );

πŸŽ€ ARGUMENTS πŸŽ€

  • driver β€” the HC driver that will use this hcd 🫢 like, this is the driver claiming the HCD for its own little world.
  • dev β€” the device for this HC, stored in hcd->self.controller ✨ yep, that exact field, bestie.
  • bus_name β€” the value to store in hcd->self.bus_name πŸŽ€ just drop it right in there.

😴 CONTEXT 😴

task context, and it might sleep 😴. Like, actually might sleep, so don't act surprised.

🌸 DESCRIPTION 🌸

So what it does: allocate a struct usb_hcd, with extra space at the end for the HC driver's private data πŸ¦‹. Then initialize the generic members of the hcd structure. That's the glow-up: fresh HCD, generic bits set up, and room for the driver's private data chillin' at the end πŸ’–.

πŸ”₯ RETURN πŸ”₯

On success, you get a pointer to the created and initialized HCD structure πŸŽ‰. On failure (e.g. if memory is unavailable), you get NULL 😭. no cap.

🌈 SEE ALSO 🌈

Kernel file ./drivers/usb/core/hcd.c, plus these besties:


source check, bestie: this page lives under ./drivers/usb/core, dated October 2026, and it's the usb_create_hcd(9) page πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from