aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM'boumba Cedric Madianga <cedric.madianga@gmail.com>2016-12-13 08:40:43 -0500
committerVinod Koul <vinod.koul@intel.com>2017-01-01 22:58:52 -0500
commit7e96304d99477de1f70db42035071e56439da817 (patch)
treefd14471cf2eef73a182a0303bcc8cd5f2c0e7ec3
parent1032471b3ec823bce7687034ac5af78a8ac99a9c (diff)
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: M'boumba Cedric Madianga <cedric.madianga@gmail.com> Reviewed-by: Ludovic BARRE <ludovic.barre@st.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/stm32-dma.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 3688d0873a3e..a884b857cba4 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -972,21 +972,18 @@ static struct dma_chan *stm32_dma_of_xlate(struct of_phandle_args *dma_spec,
972 struct stm32_dma_chan *chan; 972 struct stm32_dma_chan *chan;
973 struct dma_chan *c; 973 struct dma_chan *c;
974 974
975 if (dma_spec->args_count < 3) 975 if (dma_spec->args_count < 4)
976 return NULL; 976 return NULL;
977 977
978 cfg.channel_id = dma_spec->args[0]; 978 cfg.channel_id = dma_spec->args[0];
979 cfg.request_line = dma_spec->args[1]; 979 cfg.request_line = dma_spec->args[1];
980 cfg.stream_config = dma_spec->args[2]; 980 cfg.stream_config = dma_spec->args[2];
981 cfg.threshold = 0; 981 cfg.threshold = dma_spec->args[3];
982 982
983 if ((cfg.channel_id >= STM32_DMA_MAX_CHANNELS) || (cfg.request_line >= 983 if ((cfg.channel_id >= STM32_DMA_MAX_CHANNELS) || (cfg.request_line >=
984 STM32_DMA_MAX_REQUEST_ID)) 984 STM32_DMA_MAX_REQUEST_ID))
985 return NULL; 985 return NULL;
986 986
987 if (dma_spec->args_count > 3)
988 cfg.threshold = dma_spec->args[3];
989
990 chan = &dmadev->chan[cfg.channel_id]; 987 chan = &dmadev->chan[cfg.channel_id];
991 988
992 c = dma_get_slave_channel(&chan->vchan.chan); 989 c = dma_get_slave_channel(&chan->vchan.chan);