Now that you understand how to use the request_mem_region() and the just-seen ioremap*() APIs, guess what? The reality is that both these APIs are now considered deprecated; as a modern driver author, you're expected to use the better resource-managed devm_* APIs. (We covered the older ones for a few reasons, including the fact that many older drivers still very much use them, for understanding the basics of using the ioremap() resource management APIs, and for completeness.)
First, let's check out the new resource-managed ioremap, known as devm_ioremap(), in lib/devres.c:
/**
* devm_ioremap - Managed ioremap()
* @dev: Generic device to remap IO address for
* @offset: Resource address to map
* @size: Size of map
*
* Managed ioremap(). Map is automatically unmapped on driver detach.
*/
void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
resource_size_t size)
Just as...