aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iommu/amd_iommu.c22
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 */
2848static 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;