aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ppc4xx
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2012-03-06 17:34:46 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2012-03-13 02:06:52 -0400
commit884485e1f12dcd39390f042e772cdbefc9ebb750 (patch)
treea35fccb601c48ae1ea839aa6d62e4f102f7b66c3 /drivers/dma/ppc4xx
parentd2ebfb335b0426deb1a4fb14e4e926d81ecd8235 (diff)
dmaengine: consolidate assignment of DMA cookies
Everyone deals with assigning DMA cookies in the same way (it's part of the API so they should be), so lets consolidate the common code into a helper function to avoid this duplication. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> [imx-sdma.c & mxs-dma.c] Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/ppc4xx')
-rw-r--r--drivers/dma/ppc4xx/adma.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 40082ec8326..12e94dd6fc3 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -2151,22 +2151,6 @@ static int ppc440spe_adma_alloc_chan_resources(struct dma_chan *chan)
2151} 2151}
2152 2152
2153/** 2153/**
2154 * ppc440spe_desc_assign_cookie - assign a cookie
2155 */
2156static dma_cookie_t ppc440spe_desc_assign_cookie(
2157 struct ppc440spe_adma_chan *chan,
2158 struct ppc440spe_adma_desc_slot *desc)
2159{
2160 dma_cookie_t cookie = chan->common.cookie;
2161
2162 cookie++;
2163 if (cookie < 0)
2164 cookie = 1;
2165 chan->common.cookie = desc->async_tx.cookie = cookie;
2166 return cookie;
2167}
2168
2169/**
2170 * ppc440spe_rxor_set_region_data - 2154 * ppc440spe_rxor_set_region_data -
2171 */ 2155 */
2172static void ppc440spe_rxor_set_region(struct ppc440spe_adma_desc_slot *desc, 2156static void ppc440spe_rxor_set_region(struct ppc440spe_adma_desc_slot *desc,
@@ -2236,8 +2220,7 @@ static dma_cookie_t ppc440spe_adma_tx_submit(struct dma_async_tx_descriptor *tx)
2236 slots_per_op = group_start->slots_per_op; 2220 slots_per_op = group_start->slots_per_op;
2237 2221
2238 spin_lock_bh(&chan->lock); 2222 spin_lock_bh(&chan->lock);
2239 2223 cookie = dma_cookie_assign(tx);
2240 cookie = ppc440spe_desc_assign_cookie(chan, sw_desc);
2241 2224
2242 if (unlikely(list_empty(&chan->chain))) { 2225 if (unlikely(list_empty(&chan->chain))) {
2243 /* first peer */ 2226 /* first peer */