From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752098AbeAXBkd (ORCPT ); Tue, 23 Jan 2018 20:40:33 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:37955 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682AbeAXBk2 (ORCPT ); Tue, 23 Jan 2018 20:40:28 -0500 X-Google-Smtp-Source: AH8x226nIkPpGQ9IXQk7OMT7PyqA74oQwuk6mV3ZAQJL1rpt2hxrzXQuOfuA1ZcFeM1W9iJsPsphFw== From: Florian Fainelli To: linux-mips@linux-mips.org Cc: jhogan@kernel.org, david.daney@cavium.com, paul.burton@mips.com, Florian Fainelli , Ralf Baechle , Kevin Cernekee , Huacai Chen , Jiaxun Yang , Bart Van Assche , Doug Ledford , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] MIPS: Allow including mach-generic/dma-coherence.h Date: Tue, 23 Jan 2018 17:40:09 -0800 Message-Id: <1516758010-7641-2-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516758010-7641-1-git-send-email-f.fainelli@gmail.com> References: <1516758010-7641-1-git-send-email-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check whether a platform is already defining any of the functions we provide in mach-generic/dma-coherence.h. This is a preliminary change to allow cleaning up machine's dma-coherence.h files. Signed-off-by: Florian Fainelli --- arch/mips/include/asm/mach-generic/dma-coherence.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h index 61addb1677e9..e6e7dfa15801 100644 --- a/arch/mips/include/asm/mach-generic/dma-coherence.h +++ b/arch/mips/include/asm/mach-generic/dma-coherence.h @@ -11,29 +11,38 @@ struct device; +#ifndef plat_map_dma_mem static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) { return virt_to_phys(addr); } +#endif +#ifndef plat_map_dma_mem_page static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) { return page_to_phys(page); } +#endif +#ifndef plat_dma_addr_to_phys static inline unsigned long plat_dma_addr_to_phys(struct device *dev, dma_addr_t dma_addr) { return dma_addr; } +#endif +#ifndef plat_unmap_dma_mem static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction direction) { } +#endif +#ifndef plat_dma_supported static inline int plat_dma_supported(struct device *dev, u64 mask) { /* @@ -46,7 +55,9 @@ static inline int plat_dma_supported(struct device *dev, u64 mask) return 1; } +#endif +#ifndef plat_device_is_coherent static inline int plat_device_is_coherent(struct device *dev) { #ifdef CONFIG_DMA_PERDEV_COHERENT @@ -63,6 +74,7 @@ static inline int plat_device_is_coherent(struct device *dev) } #endif } +#endif #ifndef plat_post_dma_flush static inline void plat_post_dma_flush(struct device *dev) @@ -71,15 +83,19 @@ static inline void plat_post_dma_flush(struct device *dev) #endif #ifdef CONFIG_SWIOTLB +#ifndef phys_to_dma static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) { return paddr; } +#endif +#ifndef dma_to_phys static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) { return daddr; } #endif +#endif /* CONFIG_SWIOTLB */ #endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */ -- 2.7.4