If a driver calls pcim_enable_device(), then uses pcim_iomap(), devm_request_irq(), and other managed calls to allocate hardware resources, how does a driver tell the kernel to release those resources?
pcim_release isn’t an exported symbol, so something else must cause devres_free() to be called. But what?
Note: I don’t need directions on how to release resources manually. I want to know how to get the devres subsystem to release everything. That’s what it’s for, after all.
pcim_release()becomes thereleasecallback of thestruct devres. Thereleasecallback is called inrelease_nodes()viadevres_release_all(), which is called from a few places, notablydriver_detach().In short I think you’re not meant to worry about it, after all that’s the whole point of
devres– it manages resources for you, you don’t have to worry about the cleanup.