drm_put_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 🌈

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