comedi_pci_detach(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… comedi_pci_detach β€” a whole manual page, bestie

okay so this is a page from the Kernel API Manual and it's literally about the comedi_pci_detach(9) function, and by the end of this you're gonna know it like the back of your hand. no cap. 🫢


✨ NAME ✨

comedi_pci_detach β€” the generic "detach" handler for PCI COMEDI drivers. that's it, that's the whole name section, and it ate. πŸ’–


🌸 SYNOPSIS 🌸

void comedi_pci_detach (struct comedi_device *dev );

yes that's the whole signature. gorgeous. iconic. one argument. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the COMEDI device. that's your one (1) parameter, and she's a pointer to a struct comedi_device. main character energy fr. πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe. COMEDI drivers for PCI devices β€” but only the ones that need no special clean-up of private data and have no ioremapped regions other than the one that dev->mmio points to β€” can use this function as their "detach" handler. the COMEDI core calls it when a COMEDI device is being detached from the low-level driver. πŸ’«

and bestie, it can also be called from a more specific "detach" handler that does extra clean-up on top. so she's flexible like that. 😌

here's exactly what she does, no more no less:

  • frees the IRQ if dev->irq is non-zero πŸ”₯
  • iounmaps dev->mmio if it is non-NULL 🧚
  • calls comedi_pci_disable to release the PCI device's regions and disable it πŸ’…

that's the whole to-do list. three things. she's efficient and we love that for her.

ngl, this is a "generic" handler, so the important caveat is right there in the description: if your driver does have private data clean-up or extra ioremapped regions, this alone is not gonna cut it β€” that's exactly why the more specific "detach" handler situation exists. 🫢

🌈 SEE ALSO 🌈

like, the whole friend group. go say hi to all of them. πŸ‘―β€β™€οΈ


and that's the page!! πŸ’– this one lives under ./drivers/comedi and it's dated October 2026, and she's part of the Kernel API Manual β€” so yeah, mwah, go detach responsibly, ily, bye!! πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from