iommu/ipmmu-vmsa: Unify domain alloc/free
authorRobin Murphy <robin.murphy@arm.com>
Fri, 13 Oct 2017 18:23:39 +0000 (19:23 +0100)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 6 Nov 2017 17:27:06 +0000 (10:27 -0700)
commit1c7e7c0278df968221a5edb1a293423e13b13814
treef17e2a6ec535867d06bd76321d76deb4159c4e9a
parent105a004e2187609a74f75d55fd0f9a054b49d60a
iommu/ipmmu-vmsa: Unify domain alloc/free

We have two implementations for ipmmu_ops->alloc depending on
CONFIG_IOMMU_DMA, the difference being whether they accept the
IOMMU_DOMAIN_DMA type or not. However, iommu_dma_get_cookie() is
guaranteed to return an error when !CONFIG_IOMMU_DMA, so if
ipmmu_domain_alloc_dma() was actually checking and handling the return
value correctly, it would behave the same as ipmmu_domain_alloc()
anyway.

Similarly for freeing; iommu_put_dma_cookie() is robust by design.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/iommu/ipmmu-vmsa.c