Skip to content

Commit

Permalink
dmaengine: dw: Make error prints unique. Part #2
Browse files Browse the repository at this point in the history
The same error message is printed from different switch cases. Since both of
these jump into same error label we can move error print there and add a DMA
direction in order to make it easier to grep error from sources.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Jarkko Nikula authored and Vinod Koul committed Mar 16, 2015
1 parent 550da64 commit b260722
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/dma/dw/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,11 +815,8 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,

slave_sg_todev_fill_desc:
desc = dwc_desc_get(dwc);
if (!desc) {
dev_err(chan2dev(chan),
"not enough descriptors available\n");
if (!desc)
goto err_desc_get;
}

desc->lli.sar = mem;
desc->lli.dar = reg;
Expand Down Expand Up @@ -875,11 +872,8 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,

slave_sg_fromdev_fill_desc:
desc = dwc_desc_get(dwc);
if (!desc) {
dev_err(chan2dev(chan),
"not enough descriptors available\n");
if (!desc)
goto err_desc_get;
}

desc->lli.sar = reg;
desc->lli.dar = mem;
Expand Down Expand Up @@ -923,6 +917,8 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
return &first->txd;

err_desc_get:
dev_err(chan2dev(chan),
"not enough descriptors available. Direction %d\n", direction);
dwc_desc_put(dwc, first);
return NULL;
}
Expand Down

0 comments on commit b260722

Please sign in to comment.