Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e96304d authored by M'boumba Cedric Madianga's avatar M'boumba Cedric Madianga Committed by Vinod Koul
Browse files

dmaengine: stm32-dma: Set correct args number for DMA request from DT



This patch sets the right number of arguments to be used for DMA clients
which request channels from DT.

Signed-off-by: default avatarM'boumba Cedric Madianga <cedric.madianga@gmail.com>
Reviewed-by: default avatarLudovic BARRE <ludovic.barre@st.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 1032471b
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -972,21 +972,18 @@ static struct dma_chan *stm32_dma_of_xlate(struct of_phandle_args *dma_spec,
	struct stm32_dma_chan *chan;
	struct dma_chan *c;

	if (dma_spec->args_count < 3)
	if (dma_spec->args_count < 4)
		return NULL;

	cfg.channel_id = dma_spec->args[0];
	cfg.request_line = dma_spec->args[1];
	cfg.stream_config = dma_spec->args[2];
	cfg.threshold = 0;
	cfg.threshold = dma_spec->args[3];

	if ((cfg.channel_id >= STM32_DMA_MAX_CHANNELS) || (cfg.request_line >=
				STM32_DMA_MAX_REQUEST_ID))
		return NULL;

	if (dma_spec->args_count > 3)
		cfg.threshold = dma_spec->args[3];

	chan = &dmadev->chan[cfg.channel_id];

	c = dma_get_slave_channel(&chan->vchan.chan);