Commit 5ceda740 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

dma-direct: rename and cleanup __phys_to_dma



The __phys_to_dma vs phys_to_dma distinction isn't exactly obvious.  Try
to improve the situation by renaming __phys_to_dma to
phys_to_dma_unencryped, and not forcing architectures that want to
override phys_to_dma to actually provide __phys_to_dma.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
parent 7bc5c428
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
#ifndef ASM_ARM_DMA_DIRECT_H
#define ASM_ARM_DMA_DIRECT_H 1

static inline dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
{
	unsigned int offset = paddr & ~PAGE_MASK;
	return pfn_to_dma(dev, __phys_to_pfn(paddr)) + offset;
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ static struct bmips_dma_range *bmips_dma_ranges;

#define FLUSH_RAC		0x100

dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t pa)
dma_addr_t phys_to_dma(struct device *dev, phys_addr_t pa)
{
	struct bmips_dma_range *r;

+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ void __init octeon_pci_dma_init(void)
}
#endif /* CONFIG_PCI */

dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
{
#ifdef CONFIG_PCI
	if (dev && dev_is_pci(dev))
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
#ifndef _MIPS_DMA_DIRECT_H
#define _MIPS_DMA_DIRECT_H 1

dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr);
dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);

#endif /* _MIPS_DMA_DIRECT_H */
+1 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#include <linux/dma-direct.h>

dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
{
	return paddr | 0x80000000;
}
Loading