usb_del_gadget(9)
π usb_del_gadget(9) β the Kernel API Manual, bestie edition
okay so welcome to usb_del_gadget(9), a page from the Kernel API Manual. It's short, it's sweet, it's giving "one job, done correctly." Let's get into it π
β¨ NAME β¨
usb_del_gadget β deletes a gadget and unregisters its udc ποΈπ
π¦ SYNOPSIS π¦
void usb_del_gadget (struct usb_gadget *gadget );
that's it. that's the whole signature. no cap. β¨
πΈ ARGUMENTS πΈ
gadgetβ the gadget to be deleted. yes queen, that's the one you're yeeting. π
π DESCRIPTION π
So here's the tea, bestie: this function unbinds gadget, if it is bound. That's the whole vibe check β if it's bound, it gets unbound, slay. π
β οΈ but listen β it will not do a final usb_put_gadget. Like, it does not drop that last reference for you. The way that this is your problem and not hers ππ₯
periodt. that's literally the entire description, no filler, no fluff. π«Ά
π SEE ALSO π
the whole friend group, gathered here today π β starting with the kernel file it lives in:
Kernel file ./drivers/usb/gadget/udc/core.c
then the squad:
struct usb_udc(9)usb_ep_set_maxpacket_limit(9)usb_ep_enable(9)usb_ep_disable(9)usb_ep_alloc_request(9)usb_ep_free_request(9)usb_ep_queue(9)usb_ep_dequeue(9)usb_ep_set_halt(9)usb_ep_clear_halt(9)usb_ep_set_wedge(9)usb_ep_fifo_status(9)usb_ep_fifo_flush(9)usb_gadget_frame_number(9)usb_gadget_wakeup(9)usb_gadget_set_remote_wakeup(9)usb_gadget_set_selfpowered(9)usb_gadget_clear_selfpowered(9)usb_gadget_vbus_connect(9)usb_gadget_vbus_draw(9)usb_gadget_vbus_disconnect(9)usb_gadget_connect(9)usb_gadget_disconnect(9)usb_gadget_deactivate(9)usb_gadget_activate(9)usb_gadget_giveback_request(9)gadget_find_ep_by_name(9)usb_gadget_check_config(9)usb_udc_vbus_handler(9)usb_gadget_udc_reset(9)usb_gadget_udc_start_locked(9)usb_gadget_udc_stop_locked(9)usb_gadget_udc_set_speed(9)usb_gadget_enable_async_callbacks(9)usb_gadget_disable_async_callbacks(9)usb_udc_release(9)usb_initialize_gadget(9)usb_add_gadget(9)usb_add_gadget_udc_release(9)usb_get_gadget_udc_name(9)usb_add_gadget_udc(9)usb_del_gadget_udc(9)
okay that's the page!! π§β¨ this lil gem lives in ./drivers/usb/gadget/udc and the version vibes on this one are October 2026 β yes, it's from the future, she's a main character βπ drink some water, go unbind responsibly, mwah ππ
π¦ 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