aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-09-17 09:54:12 -0400
committerVinod Koul <vinod.koul@intel.com>2016-09-26 13:36:18 -0400
commit86145910697891c6adb8fc11c48d59cf1ec4a842 (patch)
tree8d3cb974a698f594de618d6426f1acc8ac910f5b
parent254e1254ff37239f946350fb5e93b8eea069b223 (diff)
ste_dma40: Move an assignment in d40_prep_desc()
Move one assignment for the local variable "cfg" so that its setting will only be performed after a call of the function "d40_desc_get" succeeded by this function. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/ste_dma40.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 087861af983e..07e7eb39eda1 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2198,7 +2198,7 @@ static struct d40_desc *
2198d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg, 2198d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg,
2199 unsigned int sg_len, unsigned long dma_flags) 2199 unsigned int sg_len, unsigned long dma_flags)
2200{ 2200{
2201 struct stedma40_chan_cfg *cfg = &chan->dma_cfg; 2201 struct stedma40_chan_cfg *cfg;
2202 struct d40_desc *desc; 2202 struct d40_desc *desc;
2203 int ret; 2203 int ret;
2204 2204
@@ -2206,6 +2206,7 @@ d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg,
2206 if (!desc) 2206 if (!desc)
2207 return NULL; 2207 return NULL;
2208 2208
2209 cfg = &chan->dma_cfg;
2209 desc->lli_len = d40_sg_2_dmalen(sg, sg_len, cfg->src_info.data_width, 2210 desc->lli_len = d40_sg_2_dmalen(sg, sg_len, cfg->src_info.data_width,
2210 cfg->dst_info.data_width); 2211 cfg->dst_info.data_width);
2211 if (desc->lli_len < 0) { 2212 if (desc->lli_len < 0) {