Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321164
b: refs/heads/master
c: aa4afb7
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Jul 1, 2012
1 parent 044511b commit 6b44820
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06e885b735717d1074dec13ae8b8d15edcd63255
refs/heads/master: aa4afb754d42be064ae649b74a599b9d9d04ac57
32 changes: 9 additions & 23 deletions trunk/drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,25 +1352,6 @@ static void pl08x_issue_pending(struct dma_chan *chan)
spin_unlock_irqrestore(&plchan->vc.lock, flags);
}

static int pl08x_prep_channel_resources(struct pl08x_dma_chan *plchan,
struct pl08x_txd *txd)
{
struct pl08x_driver_data *pl08x = plchan->host;
int num_llis;

num_llis = pl08x_fill_llis_for_desc(pl08x, txd);
if (!num_llis) {
unsigned long flags;

spin_lock_irqsave(&plchan->vc.lock, flags);
pl08x_free_txd(pl08x, txd);
spin_unlock_irqrestore(&plchan->vc.lock, flags);

return -EINVAL;
}
return 0;
}

static struct pl08x_txd *pl08x_get_txd(struct pl08x_dma_chan *plchan)
{
struct pl08x_txd *txd = kzalloc(sizeof(*txd), GFP_NOWAIT);
Expand Down Expand Up @@ -1430,9 +1411,11 @@ static struct dma_async_tx_descriptor *pl08x_prep_dma_memcpy(
txd->cctl |= pl08x_select_bus(pl08x->mem_buses,
pl08x->mem_buses);

ret = pl08x_prep_channel_resources(plchan, txd);
if (ret)
ret = pl08x_fill_llis_for_desc(plchan->host, txd);
if (!ret) {
pl08x_free_txd(pl08x, txd);
return NULL;
}

return vchan_tx_prep(&plchan->vc, &txd->vd, flags);
}
Expand Down Expand Up @@ -1546,9 +1529,12 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
}
}

ret = pl08x_prep_channel_resources(plchan, txd);
if (ret)
ret = pl08x_fill_llis_for_desc(plchan->host, txd);
if (!ret) {
pl08x_release_mux(plchan);
pl08x_free_txd(pl08x, txd);
return NULL;
}

return vchan_tx_prep(&plchan->vc, &txd->vd, flags);
}
Expand Down

0 comments on commit 6b44820

Please sign in to comment.