drivers: dma: si32: Prevent configuration of in-use DMA channel
As per Zephyr DMA documentation, dma_config() must not be done on a running channel. Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
This commit is contained in:
parent
4d3f6a3145
commit
67cb174241
|
@ -141,6 +141,14 @@ static int dma_si32_config(const struct device *dev, uint32_t channel, struct dm
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Prevent messing up (potentially) ongoing DMA operations and their settings. This behavior
|
||||
* is required by the Zephyr DMA API.
|
||||
*/
|
||||
if (SI32_DMACTRL_A_is_channel_enabled(SI32_DMACTRL_0, channel)) {
|
||||
LOG_ERR("DMA channel is currently in use");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
channel_descriptor = &channel_descriptors[channel];
|
||||
|
||||
if (cfg == NULL) {
|
||||
|
|
Loading…
Reference in New Issue