summaryrefslogtreecommitdiff
path: root/drivers/parisc/sba_iommu.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 03:41:31 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 03:41:31 +0300
commit9b51f04424e17051a89ab32d892ca66b2a104825 (patch)
tree919f49ed827de2b37d8f9187cbcc96d9a2cac0c5 /drivers/parisc/sba_iommu.c
parent55a7b2125cf4739a8478d2d7223310ae7393408c (diff)
parent227145eb38fbee9d88a570954b3de836c4280134 (diff)
downloadlinux-9b51f04424e17051a89ab32d892ca66b2a104825.tar.xz
Merge branch 'parisc-4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull another parisc update from Helge Deller: "Christoph Hellwig provided one patch for the parisc architecture to drop the DMA_ERROR_CODE define from the parisc architecture" * 'parisc-4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: ->mapping_error
Diffstat (limited to 'drivers/parisc/sba_iommu.c')
-rw-r--r--drivers/parisc/sba_iommu.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 87ad5fd6a7a2..4086f79d58d5 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -93,6 +93,8 @@
#define DEFAULT_DMA_HINT_REG 0
+#define SBA_MAPPING_ERROR (~(dma_addr_t)0)
+
struct sba_device *sba_list;
EXPORT_SYMBOL_GPL(sba_list);
@@ -725,7 +727,7 @@ sba_map_single(struct device *dev, void *addr, size_t size,
ioc = GET_IOC(dev);
if (!ioc)
- return DMA_ERROR_CODE;
+ return SBA_MAPPING_ERROR;
/* save offset bits */
offset = ((dma_addr_t) (long) addr) & ~IOVP_MASK;
@@ -1083,6 +1085,11 @@ sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,
}
+static int sba_mapping_error(struct device *dev, dma_addr_t dma_addr)
+{
+ return dma_addr == SBA_MAPPING_ERROR;
+}
+
static const struct dma_map_ops sba_ops = {
.dma_supported = sba_dma_supported,
.alloc = sba_alloc,
@@ -1091,6 +1098,7 @@ static const struct dma_map_ops sba_ops = {
.unmap_page = sba_unmap_page,
.map_sg = sba_map_sg,
.unmap_sg = sba_unmap_sg,
+ .mapping_error = sba_mapping_error,
};