]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
hexagon: switch to use ->mapping_error for error reporting
authorChristoph Hellwig <hch@lst.de>
Sun, 21 May 2017 10:26:24 +0000 (12:26 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 28 Jun 2017 13:54:29 +0000 (06:54 -0700)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Richard Kuo <rkuo@codeaurora.org>
arch/hexagon/include/asm/dma-mapping.h
arch/hexagon/kernel/dma.c
arch/hexagon/kernel/hexagon_ksyms.c

index d3a87bd9b68655bcf564b8a6ac85c754b9a76045..00e3f10113b0dd075854c7985e7f0a2a1fe2f0f0 100644 (file)
@@ -29,8 +29,6 @@
 #include <asm/io.h>
 
 struct device;
-extern int bad_dma_address;
-#define DMA_ERROR_CODE bad_dma_address
 
 extern const struct dma_map_ops *dma_ops;
 
index e74b65009587f51382e001c0f69154494d2e23b6..8140b1c5de68f6c4f248daeb70ab9e57a5315ab2 100644 (file)
 #include <linux/module.h>
 #include <asm/page.h>
 
+#define HEXAGON_MAPPING_ERROR  0
+
 const struct dma_map_ops *dma_ops;
 EXPORT_SYMBOL(dma_ops);
 
-int bad_dma_address;  /*  globals are automatically initialized to zero  */
-
 static inline void *dma_addr_to_virt(dma_addr_t dma_addr)
 {
        return phys_to_virt((unsigned long) dma_addr);
@@ -181,7 +181,7 @@ static dma_addr_t hexagon_map_page(struct device *dev, struct page *page,
        WARN_ON(size == 0);
 
        if (!check_addr("map_single", dev, bus, size))
-               return bad_dma_address;
+               return HEXAGON_MAPPING_ERROR;
 
        if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
                dma_sync(dma_addr_to_virt(bus), size, dir);
@@ -203,6 +203,11 @@ static void hexagon_sync_single_for_device(struct device *dev,
        dma_sync(dma_addr_to_virt(dma_handle), size, dir);
 }
 
+static int hexagon_mapping_error(struct device *dev, dma_addr_t dma_addr)
+{
+       return dma_addr == HEXAGON_MAPPING_ERROR;
+}
+
 const struct dma_map_ops hexagon_dma_ops = {
        .alloc          = hexagon_dma_alloc_coherent,
        .free           = hexagon_free_coherent,
@@ -210,6 +215,7 @@ const struct dma_map_ops hexagon_dma_ops = {
        .map_page       = hexagon_map_page,
        .sync_single_for_cpu = hexagon_sync_single_for_cpu,
        .sync_single_for_device = hexagon_sync_single_for_device,
+       .mapping_error  = hexagon_mapping_error,
        .is_phys        = 1,
 };
 
index 00bcad9cbd8f61cecf2820e7fbf1ff95c6c72988..aa248f59543194d3f99f3be6f041e262d8e5351f 100644 (file)
@@ -40,7 +40,6 @@ EXPORT_SYMBOL(memset);
 /* Additional variables */
 EXPORT_SYMBOL(__phys_offset);
 EXPORT_SYMBOL(_dflt_cache_att);
-EXPORT_SYMBOL(bad_dma_address);
 
 #define DECLARE_EXPORT(name)     \
        extern void name(void); EXPORT_SYMBOL(name)