As a driver author, you should become aware of and employ this useful routine: the devm_ioremap_resource() managed API performs the job of (validity) checking the requested I/O memory region, requesting it from the kernel (internally via the devm_request_mem_region() API), and remapping it (internally via devm_ioremap())! This makes it a useful wrapper for driver authors like you, and its usage is pretty common (in the 5.4.0 kernel code base, it's employed over 1,400 times). Its signature is as follows:
void __iomem *devm_ioremap_resource(struct device *dev, const struct resource *res);
Here's a usage example from drivers/char/hw_random/bcm2835-rng.c:
static int bcm2835_rng_probe(struct platform_device *pdev)
{
[...]
struct resource *r;
[...]
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
/* map peripheral */
priv->base = devm_ioremap_resource(dev, r);
if (IS_ERR(priv->base))
...