diff options
author | Christoph Hellwig <hch@lst.de> | 2019-02-13 10:01:31 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-02-18 14:41:04 +0300 |
commit | 7610fdf5e056ad5764d19f39db49b11608334610 (patch) | |
tree | c136aede7dbdbc55a575ff3763378ab3cdfddf49 /arch/powerpc/include/asm/dma-direct.h | |
parent | 68005b67d15a1ee5b5ddff965175728e65fa73e7 (diff) | |
download | linux-7610fdf5e056ad5764d19f39db49b11608334610.tar.xz |
powerpc/dma: remove get_dma_offset
Just fold the calculation into __phys_to_dma/__dma_to_phys as those are
the only places that should know about it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/dma-direct.h')
-rw-r--r-- | arch/powerpc/include/asm/dma-direct.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/dma-direct.h b/arch/powerpc/include/asm/dma-direct.h index 92d8aed86422..a2912b47102c 100644 --- a/arch/powerpc/include/asm/dma-direct.h +++ b/arch/powerpc/include/asm/dma-direct.h @@ -13,11 +13,15 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) static inline dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr) { - return paddr + get_dma_offset(dev); + if (!dev) + return paddr + PCI_DRAM_OFFSET; + return paddr + dev->archdata.dma_offset; } static inline phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t daddr) { - return daddr - get_dma_offset(dev); + if (!dev) + return daddr - PCI_DRAM_OFFSET; + return daddr - dev->archdata.dma_offset; } #endif /* ASM_POWERPC_DMA_DIRECT_H */ |