> +/** > + * devm_cmdmem_remap - Managed wrapper for cmdmem ioremap() > + * @dev: Generic device to remap IO address for > + * @offset: Resource address to map > + * @size: Size of map > + * > + * Managed cmdmem ioremap() wrapper. Map is automatically unmapped on > + * driver detach. > + */ > +void __iomem *devm_cmdmem_remap(struct device *dev, resource_size_t offset, > + resource_size_t size) > +{ > + if (!device_supports_cmdmem(dev)) > + return NULL; > + > + return devm_ioremap(dev, offset, size); All this could be trivially open coded in the caller.