Reputation: 523
The devm_ioremap()
API use device resource management framework, no need to unmap when driver probe fail.
What about the module when the module is unloaded? Need to be released too?
Upvotes: 1
Views: 654
Reputation: 1057
The design goal of the managed resource API (the devm_
stuff) is to avoid calling unmap
, free
, etc. when a device is released, either because of failure or removal.
The devm_iounmap
and similar is only there when you need to roll-back a previous call to devm_ioremap
.
Official doc here: https://www.kernel.org/doc/Documentation/driver-model/devres.txt
I suggest that you take a look at how drivers do it in the kernel. Learning by reading the code is a great path in the Linux Kernel.
Upvotes: 3