[DM/DMA] Use strict mode for device DMA pool

Signed-off-by: GuEe-GUI <2991707448@qq.com>
This commit is contained in:
GuEe-GUI 2024-11-27 18:26:11 +08:00 committed by Rbb666
parent 61779ef4c6
commit 8f392779ef

View File

@ -322,8 +322,14 @@ static void *dma_alloc(struct rt_device *dev, rt_size_t size,
rt_list_for_each_entry(pool, &dma_pool_nodes, list) rt_list_for_each_entry(pool, &dma_pool_nodes, list)
{ {
if ((flags & RT_DMA_F_DEVICE) && if (pool->flags & RT_DMA_F_DEVICE)
(!(pool->flags & RT_DMA_F_DEVICE) || pool->dev != dev)) {
if (!(flags & RT_DMA_F_DEVICE) || pool->dev != dev)
{
continue;
}
}
else if ((flags & RT_DMA_F_DEVICE))
{ {
continue; continue;
} }