/* Creates 1-1-1 mapping and returns @da again, which can be adjusted if 'IOVMF_DA_ANON' is set.  */
u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, u32 flags)
/* Creates 1-1-1 mapping and returns @da again, which can be adjusted if 'IOVMF_DA_ANON' is set.  */
u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, u32 flags)
{
	void *va;
	if (!obj || !obj->dev || !bytes)
		return -EINVAL;
	bytes = PAGE_ALIGN(bytes);
	va = ioremap(pa, bytes);
	if (!va)
		return -ENOMEM;
	flags &= IOVMF_HW_MASK;
	flags |= IOVMF_LINEAR;
	flags |= IOVMF_MMIO;
	flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
	da = __iommu_kmap(obj, da, pa, va, bytes, flags);
	if (IS_ERR_VALUE(da))
		iounmap(va);
	return da;
}