summaryrefslogtreecommitdiffstats
path: root/drivers/parisc/ccio-dma.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-07-05 04:55:06 +0200
committerHelge Deller <deller@gmx.de>2017-07-05 21:46:42 +0200
commit227145eb38fbee9d88a570954b3de836c4280134 (patch)
tree4c47d2411d679e654c25179873124d007dba1346 /drivers/parisc/ccio-dma.c
parentMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/... (diff)
downloadlinux-227145eb38fbee9d88a570954b3de836c4280134.tar.xz
linux-227145eb38fbee9d88a570954b3de836c4280134.zip
parisc: ->mapping_error
DMA_ERROR_CODE already went away in linux-next, but parisc unfortunately added a new instance of it without any review as far as I can tell. Move the two iommu drivers to report errors through ->mapping_error. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/parisc/ccio-dma.c')
-rw-r--r--drivers/parisc/ccio-dma.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 56c93f096de9..6aa1e7f6672f 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -110,6 +110,8 @@
#define CMD_TLB_DIRECT_WRITE 35 /* IO_COMMAND for I/O TLB Writes */
#define CMD_TLB_PURGE 33 /* IO_COMMAND to Purge I/O TLB entry */
+#define CCIO_MAPPING_ERROR (~(dma_addr_t)0)
+
struct ioa_registers {
/* Runway Supervisory Set */
int32_t unused1[12];
@@ -742,7 +744,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size,
BUG_ON(!dev);
ioc = GET_IOC(dev);
if (!ioc)
- return DMA_ERROR_CODE;
+ return CCIO_MAPPING_ERROR;
BUG_ON(size <= 0);
@@ -1023,6 +1025,11 @@ ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,
DBG_RUN_SG("%s() DONE (nents %d)\n", __func__, nents);
}
+static int ccio_mapping_error(struct device *dev, dma_addr_t dma_addr)
+{
+ return dma_addr == CCIO_MAPPING_ERROR;
+}
+
static const struct dma_map_ops ccio_ops = {
.dma_supported = ccio_dma_supported,
.alloc = ccio_alloc,
@@ -1031,6 +1038,7 @@ static const struct dma_map_ops ccio_ops = {
.unmap_page = ccio_unmap_page,
.map_sg = ccio_map_sg,
.unmap_sg = ccio_unmap_sg,
+ .mapping_error = ccio_mapping_error,
};
#ifdef CONFIG_PROC_FS