lkml.org 
[lkml]   [2017]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.9 04/54] dmaengine: stm32-dma: Set correct args number for DMA request from DT
    Date
    From: M'boumba Cedric Madianga <cedric.madianga@gmail.com>

    [ Upstream commit 7e96304d99477de1f70db42035071e56439da817 ]

    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>
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    ---
    drivers/dma/stm32-dma.c | 7 ++-----
    1 file changed, 2 insertions(+), 5 deletions(-)

    diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
    index 307547f4848d..bd758e67843c 100644
    --- a/drivers/dma/stm32-dma.c
    +++ b/drivers/dma/stm32-dma.c
    @@ -976,21 +976,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);
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-11-23 00:23    [W:2.947 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site