comedi_legacy_detach(9)
okay bestie, welcome to comedi_legacy_detach(9) from the Kernel API Manual β this page is about the generic detach helper for legacy COMEDI drivers, and itβs lowkey iconic πβ¨
π NAME π
comedi_legacy_detach β the generic (*detach) function for legacy drivers. Thatβs the whole vibe: one tidy detach handler, no drama π
β¨ SYNOPSIS β¨
void comedi_legacy_detach (struct comedi_device *dev );
π ARGUMENTS π
devβ the COMEDI device, bestie. Yes, literally just the COMEDI device π«Ά
π¦ DESCRIPTION π¦
okay so this is a simple, generic 'detach' handler for legacy COMEDI devices. Weβre talking devices that just use a single I/O port region and possibly an IRQ, and that donβt need any special clean-up for their private device or subdevice storage. Itβs giving βminimal cleanup, maximum slayβ π
It can also be called by a driver-specific 'detach' handler β so yes, itβs allowed to be the cleanup bestie for another handler too π
Hereβs the actual cleanup tea:
- If
dev->irqis non-zero, the IRQ will be freed. No leftover IRQ, periodt π₯ - If
dev->iobaseanddev->iolenare both non-zero, the I/O port region will be released. Both need to be non-zero, bestie β both, not one πΈ
πΈ SEE ALSO πΈ
The kernel file is ./drivers/comedi/drivers.c β and hereβs the whole friend group:
comedi_set_hw_dev(9)comedi_alloc_devpriv(9)comedi_alloc_subdevices(9)comedi_alloc_subdev_readback(9)comedi_readback_insn_read(9)comedi_timeout(9)comedi_dio_insn_config(9)comedi_dio_update_state(9)comedi_bytes_per_scan_cmd(9)comedi_bytes_per_scan(9)comedi_nscans_left(9)comedi_nsamples_left(9)comedi_inc_scan_progress(9)comedi_handle_events(9)comedi_load_firmware(9)__comedi_check_request_region(9)comedi_check_request_region(9)comedi_auto_config(9)comedi_auto_unconfig(9)comedi_driver_register(9)comedi_driver_unregister(9)
okay thatβs the page, bestie. Signed off from source/version ./drivers/comedi β Kernel API Manual β date October 2026. Stay detach-ed and iconic π
β¨π«Ά
π¦ 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