--- zzzz-none-000/linux-5.4.213/kernel/dma/coherent.c 2022-09-15 10:04:56.000000000 +0000 +++ miami-7690-761/linux-5.4.213/kernel/dma/coherent.c 2024-05-29 11:20:02.000000000 +0000 @@ -122,6 +122,18 @@ dma_release_coherent_memory(mem); return ret; } +EXPORT_SYMBOL(dma_declare_coherent_memory); + +void dma_release_declared_memory(struct device *dev) +{ + struct dma_coherent_mem *mem = dev->dma_mem; + + if (!mem) + return; + dma_release_coherent_memory(mem); + dev->dma_mem = NULL; +} +EXPORT_SYMBOL(dma_release_declared_memory); static void *__dma_alloc_from_coherent(struct device *dev, struct dma_coherent_mem *mem,