Merge tag 'iommu-updates-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / iommu / iommu.c
index b4499b1..3303d70 100644 (file)
@@ -2650,9 +2650,9 @@ size_t iommu_unmap_fast(struct iommu_domain *domain,
 }
 EXPORT_SYMBOL_GPL(iommu_unmap_fast);
 
-static size_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
-                            struct scatterlist *sg, unsigned int nents, int prot,
-                            gfp_t gfp)
+static ssize_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
+               struct scatterlist *sg, unsigned int nents, int prot,
+               gfp_t gfp)
 {
        const struct iommu_ops *ops = domain->ops;
        size_t len = 0, mapped = 0;
@@ -2693,19 +2693,18 @@ out_err:
        /* undo mappings already done */
        iommu_unmap(domain, iova, mapped);
 
-       return 0;
-
+       return ret;
 }
 
-size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
-                   struct scatterlist *sg, unsigned int nents, int prot)
+ssize_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
+                    struct scatterlist *sg, unsigned int nents, int prot)
 {
        might_sleep();
        return __iommu_map_sg(domain, iova, sg, nents, prot, GFP_KERNEL);
 }
 EXPORT_SYMBOL_GPL(iommu_map_sg);
 
-size_t iommu_map_sg_atomic(struct iommu_domain *domain, unsigned long iova,
+ssize_t iommu_map_sg_atomic(struct iommu_domain *domain, unsigned long iova,
                    struct scatterlist *sg, unsigned int nents, int prot)
 {
        return __iommu_map_sg(domain, iova, sg, nents, prot, GFP_ATOMIC);