diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-17 19:05:14 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-11-06 14:23:23 +0100 |
commit | 9b2fbc11d6c9e866a61ad86bdfe1c629edb18f80 (patch) | |
tree | 72d357f4d4dfdd19311833e8dd28653211e3cde4 | |
parent | 440a8becb4eec1b661292dfe2391748c4a65600c (diff) | |
download | linux-stericsson-9b2fbc11d6c9e866a61ad86bdfe1c629edb18f80.tar.gz |
ARM/dma-mapping: don't handle NULL devices in dma-direct.h
The DMA API removed support for not passing in a device a long time
ago, so remove the NULL checks.
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | arch/arm/include/asm/dma-direct.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/arm/include/asm/dma-direct.h b/arch/arm/include/asm/dma-direct.h index 1f04a5e1c615..84cb4e306588 100644 --- a/arch/arm/include/asm/dma-direct.h +++ b/arch/arm/include/asm/dma-direct.h @@ -11,7 +11,7 @@ */ static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn) { - if (dev && dev->dma_range_map) + if (dev->dma_range_map) pfn = PFN_DOWN(translate_phys_to_dma(dev, PFN_PHYS(pfn))); return (dma_addr_t)__pfn_to_phys(pfn); } @@ -20,16 +20,13 @@ static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr) { unsigned long pfn = __phys_to_pfn(addr); - if (dev && dev->dma_range_map) + if (dev->dma_range_map) pfn = PFN_DOWN(translate_dma_to_phys(dev, PFN_PHYS(pfn))); return pfn; } static inline dma_addr_t virt_to_dma(struct device *dev, void *addr) { - if (dev) - return pfn_to_dma(dev, virt_to_pfn(addr)); - return (dma_addr_t)__virt_to_bus((unsigned long)(addr)); } |