diff options
author | Joerg Roedel <joro@8bytes.org> | 2013-04-09 09:04:36 -0400 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2013-04-18 11:19:45 -0400 |
commit | a0e191b23d93464bf8726eba8da081d23c08e185 (patch) | |
tree | a3c7c2aaadf888c15c0e39dc35b37ba548f6f7fa /drivers/iommu | |
parent | 925fe08bce38d1ff052fe2209b9e2b8d5fbb7f98 (diff) |
iommu/amd: Remove map_sg_no_iommu()
This function was intended as a fall-back if the map_sg
function is called for a device not mapped by the IOMMU.
Since the AMD IOMMU driver uses per-device dma_ops this can
never happen. So this function isn't needed anymore.
Reviewed-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index d6433e2a3bb4..93b18746d711 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -2842,24 +2842,6 @@ static void unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
2842 | } | 2842 | } |
2843 | 2843 | ||
2844 | /* | 2844 | /* |
2845 | * This is a special map_sg function which is used if we should map a | ||
2846 | * device which is not handled by an AMD IOMMU in the system. | ||
2847 | */ | ||
2848 | static int map_sg_no_iommu(struct device *dev, struct scatterlist *sglist, | ||
2849 | int nelems, int dir) | ||
2850 | { | ||
2851 | struct scatterlist *s; | ||
2852 | int i; | ||
2853 | |||
2854 | for_each_sg(sglist, s, nelems, i) { | ||
2855 | s->dma_address = (dma_addr_t)sg_phys(s); | ||
2856 | s->dma_length = s->length; | ||
2857 | } | ||
2858 | |||
2859 | return nelems; | ||
2860 | } | ||
2861 | |||
2862 | /* | ||
2863 | * The exported map_sg function for dma_ops (handles scatter-gather | 2845 | * The exported map_sg function for dma_ops (handles scatter-gather |
2864 | * lists). | 2846 | * lists). |
2865 | */ | 2847 | */ |
@@ -2878,9 +2860,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist, | |||
2878 | INC_STATS_COUNTER(cnt_map_sg); | 2860 | INC_STATS_COUNTER(cnt_map_sg); |
2879 | 2861 | ||
2880 | domain = get_domain(dev); | 2862 | domain = get_domain(dev); |
2881 | if (PTR_ERR(domain) == -EINVAL) | 2863 | if (IS_ERR(domain)) |
2882 | return map_sg_no_iommu(dev, sglist, nelems, dir); | ||
2883 | else if (IS_ERR(domain)) | ||
2884 | return 0; | 2864 | return 0; |
2885 | 2865 | ||
2886 | dma_mask = *dev->dma_mask; | 2866 | dma_mask = *dev->dma_mask; |