aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/iommu.c
diff options
context:
space:
mode:
authorMartin Oliveira <martin.oliveira@eideticom.com>2021-07-29 14:15:32 -0600
committerChristoph Hellwig <hch@lst.de>2021-08-09 17:13:06 +0200
commite02373fddb0ea86ce3962bb5d38e20ea0b6c8a05 (patch)
treeb23334f08013221ea318befc3146d15e673d56fb /arch/sparc/kernel/iommu.c
parent7e4e7d4c54ecc9986041aae84e04280413f2435b (diff)
downloadlinux-e02373fddb0ea86ce3962bb5d38e20ea0b6c8a05.tar.gz
sparc/iommu: return error codes from .map_sg() ops
The .map_sg() op now expects an error code instead of zero on failure. Returning an errno from __sbus_iommu_map_sg() results in sbus_iommu_map_sg_gflush() and sbus_iommu_map_sg_pflush() returning an errno, as those functions are wrappers around __sbus_iommu_map_sg(). Signed-off-by: Martin Oliveira <martin.oliveira@eideticom.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Niklas Schnelle <schnelle@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/sparc/kernel/iommu.c')
-rw-r--r--arch/sparc/kernel/iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index a034f571d869..0589acd34201 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -448,7 +448,7 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
iommu = dev->archdata.iommu;
strbuf = dev->archdata.stc;
if (nelems == 0 || !iommu)
- return 0;
+ return -EINVAL;
spin_lock_irqsave(&iommu->lock, flags);
@@ -580,7 +580,7 @@ iommu_map_failed:
}
spin_unlock_irqrestore(&iommu->lock, flags);
- return 0;
+ return -EINVAL;
}
/* If contexts are being used, they are the same in all of the mappings