drm_put_dev(9)
π drm_put_dev(9) β like, the kernel API manual edition β¨
Okay bestie, buckle up π this one lives in the Kernel API Manual, and it's the page about saying goodbye to a DRM device. Yes, we're doing a breakup arc. π
πΈ NAME πΈ
drm_put_dev β unregister and release a DRM device. It's giving "closing the tab on a whole graphics device" energy. π₯οΈβ¨
π¦ SYNOPSIS π¦
void drm_put_dev (struct drm_device *dev );
That's it. That's the whole signature. One function, one pointer, no cap. π
π ARGUMENTS π
devβ the DRM device. That's it. That's the whole argument. The main character of this function. π
β¨ DESCRIPTION β¨
So here's the tea β: this function gets called at module unload time, or when a PCI device is unplugged. Like when the hardware literally leaves the group chat. π«
It cleans up the entire DRM device, and on its way out it calls drm_lastclose. So it's not just leaving β it's tidying up, turning off the lights, and closing the door behind itself. Considerate icon behavior, honestly. πͺβ¨
π NOTE π
Bestie, listen to me. π¨ Use of this function is deprecated. It will eventually go away completely. Not "maybe." Will. π
So instead of this, please use drm_dev_unregister and drm_dev_put β explicitly, like the independent queen you are π
. Why? Because doing it that way makes sure that the device isn't userspace accessible any more while teardown is in progress, which ensures that userspace can't access an inconsistent state.
Translation: do it the explicit way so nothing in userspace can wander into the half-dismantled device like it's an abandoned party and touch stuff mid-teardown. π Not the vibe. Never the vibe.
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_drv.c driver instance overview(9)drm_dev_enter(9)drm_dev_exit(9)drm_dev_unplug(9)drm_dev_set_dma_dev(9)drm_dev_wedged_event(9)component helper usage recommendations(9)__drm_dev_alloc(9)drm_dev_alloc(9)drm_dev_get(9)drm_dev_put(9)drmm_cgroup_register_region(9)drm_dev_register(9)drm_dev_unregister(9)
Go read them. All of them. I believe in you. π«Άπ
And that's the whole page, bestie!! π This little cutie lives in ./drivers/gpu/drm, and this version is dated October 2026, still filed under drm_put_dev(9) β mwah, slay, periodt. πβ¨π¦π
π¦ 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