pci_dev_get(9)
π pci_dev_get(9) β from the Kernel API Manual, bestie π
okay so we're diving into the kernel API manual today and honestly? this one's a little baddie with a big job: it bumps the reference count on a pci_dev struct. that's it. that's the whole vibe. let's get into it β¨
πΈ NAME πΈ
pci_dev_get β increments the reference count of the pci device structure π
like, it's giving "you're mine now and i'm keeping track of you" energy. no cap.
π¦ SYNOPSIS π¦
struct pci_dev * pci_dev_get (struct pci_dev *dev );
one function, one argument, one pointer returned. clean, iconic, minimal. periodt.
β¨ ARGUMENTS β¨
devβ the device being referenced π«Ά literally the pci device you're pledging your loyalty to.
π DESCRIPTION π
okay so here's the tea, bestie: each live reference to a device should be refcounted. that's just how we do things around here β everybody keeping receipts on who's holding onto what π
drivers for PCI devices should normally record such references in their probe methods, when they bind to a device, and release them by calling pci_dev_put, in their disconnect methods. so likeβ¦ pci_dev_get in probe, pci_dev_put in disconnect. a whole matching set, we love a coordinated moment π
πΈ
and finally: a pointer to the device with the incremented reference counter is returned β¨ so yes, you do get the pointer back, elevated, refcounted, main character energy π
π₯ SEE ALSO π₯
Kernel file ./drivers/pci/pci-driver.c β go read the source, it's right there, iykyk π β plus these absolutely iconic siblings:
do_pci_add_dynid(9)pci_add_dynid(9)do_pci_match_id(9)pci_match_id(9)pci_match_device(9)new_id_store(9)remove_id_store(9)__pci_device_probe(9)pci_restore_standard_config(9)__pci_register_driver(9)pci_unregister_driver(9)pci_dev_driver(9)pci_bus_match(9)pci_dev_put(9)pci_uevent_ers(9)pci_dma_configure(9)
the way this is a whole friend group of functions and pci_dev_put(9) is literally right there as the other half of the duo ππ«Ά
okay that's the page!! this lil gem lives under ./drivers/pci, stamped October 2026, and it's filed as pci_dev_get(9) in case you need to find your way back π go forth and refcount responsibly, bestie π§β¨
π¦ 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