Revert "LoongArch: Remove the unused dma-direct.h"

This reverts commit f6758eb792.

Removing dma-direct.h causes build errors when CONFIG_ARCH_HAS_PHYS_TO_DMA
is enabled. This option is needed for compatibility reasons, so dma-direct.h
cannot be removed.

The build error occurs because arch/loongarch/kernel/dma.c includes
include/linux/dma-direct.h, which in turn tries to include asm/dma-direct.h
when CONFIG_ARCH_HAS_PHYS_TO_DMA is defined.

Fixes: f6758eb792 ("LoongArch: Remove the unused dma-direct.h")
Signed-off-by: Ming Wang <wangming01@loongson.cn>
This commit is contained in:
Ming Wang 2024-10-30 19:24:27 +08:00
parent 845fdb6ca6
commit 6bfbae2cf0
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
*/
#ifndef _LOONGARCH_DMA_DIRECT_H
#define _LOONGARCH_DMA_DIRECT_H
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 /* _LOONGARCH_DMA_DIRECT_H */