From b8ee205af46cd060648814bc248fe57d85f61ac9 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 20 Dec 2017 15:56:04 +0100 Subject: riscv: remove the unused dma_capable helper Signed-off-by: Christoph Hellwig --- arch/riscv/include/asm/dma-mapping.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'arch/riscv') diff --git a/arch/riscv/include/asm/dma-mapping.h b/arch/riscv/include/asm/dma-mapping.h index 3eec1000196d..73849e2cc761 100644 --- a/arch/riscv/include/asm/dma-mapping.h +++ b/arch/riscv/include/asm/dma-mapping.h @@ -27,12 +27,4 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) return &dma_noop_ops; } -static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) -{ - if (!dev->dma_mask) - return false; - - return addr + size - 1 <= *dev->dma_mask; -} - #endif /* __ASM_RISCV_DMA_MAPPING_H */ -- cgit From c5cd037d1c8044fbd131c57822a67a1576eb16e9 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 23 Dec 2017 10:56:51 +0100 Subject: dma-mapping: provide a generic asm/dma-mapping.h For architectures that just use the generic dma_noop_ops we can provide a generic version of dma-mapping.h. Signed-off-by: Christoph Hellwig --- arch/riscv/include/asm/Kbuild | 1 + arch/riscv/include/asm/dma-mapping.h | 30 ------------------------------ 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 arch/riscv/include/asm/dma-mapping.h (limited to 'arch/riscv') diff --git a/arch/riscv/include/asm/Kbuild b/arch/riscv/include/asm/Kbuild index 970460a0b492..197460ccbf21 100644 --- a/arch/riscv/include/asm/Kbuild +++ b/arch/riscv/include/asm/Kbuild @@ -7,6 +7,7 @@ generic-y += device.h generic-y += div64.h generic-y += dma.h generic-y += dma-contiguous.h +generic-y += dma-mapping.h generic-y += emergency-restart.h generic-y += errno.h generic-y += exec.h diff --git a/arch/riscv/include/asm/dma-mapping.h b/arch/riscv/include/asm/dma-mapping.h deleted file mode 100644 index 73849e2cc761..000000000000 --- a/arch/riscv/include/asm/dma-mapping.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2003-2004 Hewlett-Packard Co - * David Mosberger-Tang - * Copyright (C) 2012 ARM Ltd. - * Copyright (C) 2016 SiFive, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef __ASM_RISCV_DMA_MAPPING_H -#define __ASM_RISCV_DMA_MAPPING_H - -/* Use ops->dma_mapping_error (if it exists) or assume success */ -// #undef DMA_ERROR_CODE - -static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) -{ - return &dma_noop_ops; -} - -#endif /* __ASM_RISCV_DMA_MAPPING_H */ -- cgit From 002e67454f61bb67d8071ac4d0cacb86a01d18e0 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 9 Jan 2018 16:30:23 +0100 Subject: dma-direct: rename dma_noop to dma_direct The trivial direct mapping implementation already does a virtual to physical translation which isn't strictly a noop, and will soon learn to do non-direct but linear physical to dma translations through the device offset and a few small tricks. Rename it to a better fitting name. Signed-off-by: Christoph Hellwig Reviewed-by: Vladimir Murzin --- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/riscv') diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 2c6adf12713a..865e14f50c14 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -83,7 +83,7 @@ config PGTABLE_LEVELS config HAVE_KPROBES def_bool n -config DMA_NOOP_OPS +config DMA_DIRECT_OPS def_bool y menu "Platform type" -- cgit