aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorHiroshi Doyu <hdoyu@nvidia.com>2013-01-24 08:16:57 -0500
committerMarek Szyprowski <m.szyprowski@samsung.com>2013-02-25 09:30:41 -0500
commit6fe367580339a3adf77273d4366652665319bdeb (patch)
tree211fd3d066c016afaac35d1802d7cd09b64a1f73 /arch/arm/mm
parentfab112a394b9cf5e3bf888af6ff5076ba9fa0f06 (diff)
ARM: dma-mapping: Add arm_iommu_detach_device()
A counter part of arm_iommu_attach_device(). Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/dma-mapping.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index d91c4880f559..6563e3872659 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1848,4 +1848,29 @@ int arm_iommu_attach_device(struct device *dev,
1848 return 0; 1848 return 0;
1849} 1849}
1850 1850
1851/**
1852 * arm_iommu_detach_device
1853 * @dev: valid struct device pointer
1854 *
1855 * Detaches the provided device from a previously attached map.
1856 * This voids the dma operations (dma_map_ops pointer)
1857 */
1858void arm_iommu_detach_device(struct device *dev)
1859{
1860 struct dma_iommu_mapping *mapping;
1861
1862 mapping = to_dma_iommu_mapping(dev);
1863 if (!mapping) {
1864 dev_warn(dev, "Not attached\n");
1865 return;
1866 }
1867
1868 iommu_detach_device(mapping->domain, dev);
1869 kref_put(&mapping->kref, release_iommu_mapping);
1870 mapping = NULL;
1871 set_dma_ops(dev, NULL);
1872
1873 pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev));
1874}
1875
1851#endif 1876#endif