aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/amba-pl08x.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-01-03 17:36:09 -0500
committerDan Williams <dan.j.williams@intel.com>2011-01-04 22:16:11 -0500
commit8c8cc2b1040f51a2f89724edbf976774128339eb (patch)
tree367430b053afd6dd07e994da78f840f5221b9dd3 /drivers/dma/amba-pl08x.c
parentac3cd20df9d74bb205bb34f69407477a884ff8a3 (diff)
ARM: PL08x: consolidate physical channel release code
Consolidate duplicated channel release code into release_phy_channel() Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/amba-pl08x.c')
-rw-r--r--drivers/dma/amba-pl08x.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d47255ee9504..e8967ff44fc2 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -1058,6 +1058,18 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
1058 return 0; 1058 return 0;
1059} 1059}
1060 1060
1061static void release_phy_channel(struct pl08x_dma_chan *plchan)
1062{
1063 struct pl08x_driver_data *pl08x = plchan->host;
1064
1065 if ((plchan->phychan->signal >= 0) && pl08x->pd->put_signal) {
1066 pl08x->pd->put_signal(plchan);
1067 plchan->phychan->signal = -1;
1068 }
1069 pl08x_put_phy_channel(pl08x, plchan->phychan);
1070 plchan->phychan = NULL;
1071}
1072
1061static dma_cookie_t pl08x_tx_submit(struct dma_async_tx_descriptor *tx) 1073static dma_cookie_t pl08x_tx_submit(struct dma_async_tx_descriptor *tx)
1062{ 1074{
1063 struct pl08x_dma_chan *plchan = to_pl08x_chan(tx->chan); 1075 struct pl08x_dma_chan *plchan = to_pl08x_chan(tx->chan);
@@ -1522,13 +1534,7 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
1522 * Mark physical channel as free and free any slave 1534 * Mark physical channel as free and free any slave
1523 * signal 1535 * signal
1524 */ 1536 */
1525 if ((plchan->phychan->signal >= 0) && 1537 release_phy_channel(plchan);
1526 pl08x->pd->put_signal) {
1527 pl08x->pd->put_signal(plchan);
1528 plchan->phychan->signal = -1;
1529 }
1530 pl08x_put_phy_channel(pl08x, plchan->phychan);
1531 plchan->phychan = NULL;
1532 } 1538 }
1533 /* Dequeue jobs and free LLIs */ 1539 /* Dequeue jobs and free LLIs */
1534 if (plchan->at) { 1540 if (plchan->at) {
@@ -1590,7 +1596,6 @@ static void pl08x_ensure_on(struct pl08x_driver_data *pl08x)
1590static void pl08x_tasklet(unsigned long data) 1596static void pl08x_tasklet(unsigned long data)
1591{ 1597{
1592 struct pl08x_dma_chan *plchan = (struct pl08x_dma_chan *) data; 1598 struct pl08x_dma_chan *plchan = (struct pl08x_dma_chan *) data;
1593 struct pl08x_phy_chan *phychan = plchan->phychan;
1594 struct pl08x_driver_data *pl08x = plchan->host; 1599 struct pl08x_driver_data *pl08x = plchan->host;
1595 unsigned long flags; 1600 unsigned long flags;
1596 1601
@@ -1642,12 +1647,7 @@ static void pl08x_tasklet(unsigned long data)
1642 * No more jobs, so free up the physical channel 1647 * No more jobs, so free up the physical channel
1643 * Free any allocated signal on slave transfers too 1648 * Free any allocated signal on slave transfers too
1644 */ 1649 */
1645 if ((phychan->signal >= 0) && pl08x->pd->put_signal) { 1650 release_phy_channel(plchan);
1646 pl08x->pd->put_signal(plchan);
1647 phychan->signal = -1;
1648 }
1649 pl08x_put_phy_channel(pl08x, phychan);
1650 plchan->phychan = NULL;
1651 plchan->state = PL08X_CHAN_IDLE; 1651 plchan->state = PL08X_CHAN_IDLE;
1652 1652
1653 /* 1653 /*