drivers: dma: stm32 initialize a dma_stm32_data structure

In the dma.h there is a dma_ctx structure using a magic code
to be identify. This structure must be prepared as a new
element of the dma_stm32_data.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2021-08-04 16:58:04 +02:00 committed by Anas Nashif
commit e90c47fbc4
2 changed files with 5 additions and 0 deletions

View file

@ -610,6 +610,10 @@ static int dma_stm32_init(const struct device *dev)
#endif /* CONFIG_DMAMUX_STM32 */
}
((struct dma_stm32_data *)dev->data)->dma_ctx.magic = 0;
((struct dma_stm32_data *)dev->data)->dma_ctx.dma_channels = 0;
((struct dma_stm32_data *)dev->data)->dma_ctx.atomic = 0;
return 0;
}

View file

@ -30,6 +30,7 @@ struct dma_stm32_stream {
};
struct dma_stm32_data {
struct dma_context dma_ctx;
};
struct dma_stm32_config {