aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ste_dma40.c
diff options
context:
space:
mode:
authorPer Friden <per.friden@stericsson.com>2010-06-20 17:24:59 -0400
committerDan Williams <dan.j.williams@intel.com>2010-06-22 21:01:53 -0400
commita8be8627a3a00859367d219848f2cd771d6aa925 (patch)
treee7ef04effe6dd5102fea73f2f77da14bd6e2dee9 /drivers/dma/ste_dma40.c
parentef1872ec652b3bc472d6c0995d0b64d5058878ea (diff)
DMAENGINE: ste_dma40: moved freeing of client owned desc
fixed typo and moved freeing of client owned desc to free_dma. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/ste_dma40.c')
-rw-r--r--drivers/dma/ste_dma40.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 9655452f0b69..d72eff6cfaef 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -374,7 +374,6 @@ static void d40_desc_remove(struct d40_desc *d40d)
374 374
375static struct d40_desc *d40_desc_get(struct d40_chan *d40c) 375static struct d40_desc *d40_desc_get(struct d40_chan *d40c)
376{ 376{
377 struct d40_desc *desc;
378 struct d40_desc *d; 377 struct d40_desc *d;
379 struct d40_desc *_d; 378 struct d40_desc *_d;
380 379
@@ -583,8 +582,6 @@ done:
583static void d40_term_all(struct d40_chan *d40c) 582static void d40_term_all(struct d40_chan *d40c)
584{ 583{
585 struct d40_desc *d40d; 584 struct d40_desc *d40d;
586 struct d40_desc *d;
587 struct d40_desc *_d;
588 585
589 /* Release active descriptors */ 586 /* Release active descriptors */
590 while ((d40d = d40_first_active_get(d40c))) { 587 while ((d40d = d40_first_active_get(d40c))) {
@@ -602,15 +599,6 @@ static void d40_term_all(struct d40_chan *d40c)
602 d40_desc_free(d40c, d40d); 599 d40_desc_free(d40c, d40d);
603 } 600 }
604 601
605 /* Release client owned descriptors */
606 if (!list_empty(&d40c->client))
607 list_for_each_entry_safe(d, _d, &d40c->client, node) {
608 d40_pool_lli_free(d);
609 d40_desc_remove(d);
610 /* Return desc to free-list */
611 d40_desc_free(d40c, d40d);
612 }
613
614 d40_lcla_id_put(d40c, &d40c->base->lcla_pool, 602 d40_lcla_id_put(d40c, &d40c->base->lcla_pool,
615 d40c->lcla.src_id); 603 d40c->lcla.src_id);
616 d40_lcla_id_put(d40c, &d40c->base->lcla_pool, 604 d40_lcla_id_put(d40c, &d40c->base->lcla_pool,
@@ -1240,10 +1228,22 @@ static int d40_free_dma(struct d40_chan *d40c)
1240 u32 event, dir; 1228 u32 event, dir;
1241 struct d40_phy_res *phy = d40c->phy_chan; 1229 struct d40_phy_res *phy = d40c->phy_chan;
1242 bool is_src; 1230 bool is_src;
1231 struct d40_desc *d;
1232 struct d40_desc *_d;
1233
1243 1234
1244 /* Terminate all queued and active transfers */ 1235 /* Terminate all queued and active transfers */
1245 d40_term_all(d40c); 1236 d40_term_all(d40c);
1246 1237
1238 /* Release client owned descriptors */
1239 if (!list_empty(&d40c->client))
1240 list_for_each_entry_safe(d, _d, &d40c->client, node) {
1241 d40_pool_lli_free(d);
1242 d40_desc_remove(d);
1243 /* Return desc to free-list */
1244 d40_desc_free(d40c, d);
1245 }
1246
1247 if (phy == NULL) { 1247 if (phy == NULL) {
1248 dev_err(&d40c->chan.dev->device, "[%s] phy == null\n", 1248 dev_err(&d40c->chan.dev->device, "[%s] phy == null\n",
1249 __func__); 1249 __func__);