usb_alloc_dev(9)
π usb_alloc_dev(9) π
okay so bestie, welcome to this page from the Kernel API Manual β it's all about usb_alloc_dev(9), the usb device constructor, and it's very much usbcore-internal business. π§β¨
πΈ NAME πΈ
usb_alloc_dev β usb device constructor (usbcore-internal)
π SYNOPSIS π
struct usb_device * usb_alloc_dev (struct usb_device *parent , struct usb_bus *bus , unsigned port1 );
π¦ ARGUMENTS π¦
parentβ the hub to which the device is connected;nullto allocate a root hub. πbusβ the bus used to access the device. πport1β one-based index of the port; ignored for root hubs. π’
π CONTEXT π
task context, might sleep. π΄ So yeah, this one can catch some z's β it's giving sleepy-time energy, lowkey.
π₯ DESCRIPTION π₯
The way that only hub drivers β including virtual root hub drivers for host controllers β should ever call this is so real. π No cap: this one is for the hub-driver girlies, not everybody.
And bestie, this call may not be used in a non-sleeping context. π¨ Fr fr, do not pop this in a non-sleeping context, periodt. π
β RETURN β
On success, you get a pointer to the allocated usb device. π«Ά On failure, it's NULL. π
π SEE ALSO π
Kernel file: ./drivers/usb/core/usb.c π
usb_find_common_endpoints(9)usb_find_common_endpoints_reverse(9)usb_find_endpoint(9)usb_check_bulk_endpoints(9)usb_check_int_endpoints(9)usb_find_alt_setting(9)usb_ifnum_to_if(9)usb_altnum_to_altsetting(9)usb_find_interface(9)usb_for_each_dev(9)usb_release_dev(9)usb_get_dev(9)usb_put_dev(9)usb_get_intf(9)usb_put_intf(9)usb_intf_get_dma_device(9)usb_lock_device_for_reset(9)usb_get_current_frame_number(9)usb_alloc_coherent(9)usb_free_coherent(9)usb_alloc_noncoherent(9)usb_free_noncoherent(9)usb_endpoint_max_periodic_payload(9)usb_endpoint_is_hs_isoc_double(9)
mwah π signing off from ./drivers/usb/core β October 2026 β usb_alloc_dev(9) π«Άβ¨
π¦ 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