dmaengine: initialize tx_list in dma_async_tx_descriptor_init
authorDan Williams <dan.j.williams@intel.com>
Wed, 25 Mar 2009 16:13:24 +0000 (09:13 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 25 Mar 2009 16:13:24 +0000 (09:13 -0700)
Centralize this common initialization (and one case where ipu_idmac is
duplicating ->chan initialization).

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/dmaengine.c
drivers/dma/dw_dmac.c
drivers/dma/fsldma.c
drivers/dma/ioat_dma.c
drivers/dma/iop-adma.c
drivers/dma/ipu/ipu_idmac.c
drivers/dma/mv_xor.c

index 49243d14b894a53e5f9e13dc367d649dadbfd193..a41d1ea10fa3a2813b9ada001b07895fe196614c 100644 (file)
@@ -920,6 +920,7 @@ void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
 {
        tx->chan = chan;
        spin_lock_init(&tx->lock);
+       INIT_LIST_HEAD(&tx->tx_list);
 }
 EXPORT_SYMBOL(dma_async_tx_descriptor_init);
 
index a97c07eef7ec92468c24150669e690033f310a4f..862fc9ce9d8652e083fb4001049903ccca70c83e 100644 (file)
@@ -826,7 +826,6 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan)
                dma_async_tx_descriptor_init(&desc->txd, chan);
                desc->txd.tx_submit = dwc_tx_submit;
                desc->txd.flags = DMA_CTRL_ACK;
-               INIT_LIST_HEAD(&desc->txd.tx_list);
                desc->txd.phys = dma_map_single(chan2parent(chan), &desc->lli,
                                sizeof(desc->lli), DMA_TO_DEVICE);
                dwc_desc_put(dwc, desc);
index 86d6da47f558765736149344b2c595b13a289f3f..da8a8ed9e411008d68e14820444695176caa9318 100644 (file)
@@ -354,7 +354,6 @@ static struct fsl_desc_sw *fsl_dma_alloc_descriptor(
                dma_async_tx_descriptor_init(&desc_sw->async_tx,
                                                &fsl_chan->common);
                desc_sw->async_tx.tx_submit = fsl_dma_tx_submit;
-               INIT_LIST_HEAD(&desc_sw->async_tx.tx_list);
                desc_sw->async_tx.phys = pdesc;
        }
 
index 5905cd36bcd23b43b86dcc532a1a70cc5ce5ce58..e4fc33c1c32f89fc99711ca2c759f15e79eeaa62 100644 (file)
@@ -693,7 +693,6 @@ static struct ioat_desc_sw *ioat_dma_alloc_descriptor(
                desc_sw->async_tx.tx_submit = ioat2_tx_submit;
                break;
        }
-       INIT_LIST_HEAD(&desc_sw->async_tx.tx_list);
 
        desc_sw->hw = desc;
        desc_sw->async_tx.phys = phys;
index 16adbe61cfb2cd60efd1a01246be3f9c9f4eac43..2f052265122f62e2681bbdb0dfbbd558cef24713 100644 (file)
@@ -498,7 +498,6 @@ static int iop_adma_alloc_chan_resources(struct dma_chan *chan)
                slot->async_tx.tx_submit = iop_adma_tx_submit;
                INIT_LIST_HEAD(&slot->chain_node);
                INIT_LIST_HEAD(&slot->slot_node);
-               INIT_LIST_HEAD(&slot->async_tx.tx_list);
                hw_desc = (char *) iop_chan->device->dma_desc_pool;
                slot->async_tx.phys =
                        (dma_addr_t) &hw_desc[idx * IOP_ADMA_SLOT_SIZE];
index 0a525c450f24faf2f1cb3a8f4c67f981f5222225..7ce0e25266dc487b9de96a4cf273c89737c46e6d 100644 (file)
@@ -983,8 +983,6 @@ static int idmac_desc_alloc(struct idmac_channel *ichan, int n)
                memset(txd, 0, sizeof(*txd));
                dma_async_tx_descriptor_init(txd, &ichan->dma_chan);
                txd->tx_submit          = idmac_tx_submit;
-               txd->chan               = &ichan->dma_chan;
-               INIT_LIST_HEAD(&txd->tx_list);
 
                list_add(&desc->list, &ichan->free_list);
 
index cb7f26fb9f188ce594081069bd61c6e99c957930..ddab94f512247d600a1488a44d27a832f8ee9d3c 100644 (file)
@@ -632,7 +632,6 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
                slot->async_tx.tx_submit = mv_xor_tx_submit;
                INIT_LIST_HEAD(&slot->chain_node);
                INIT_LIST_HEAD(&slot->slot_node);
-               INIT_LIST_HEAD(&slot->async_tx.tx_list);
                hw_desc = (char *) mv_chan->device->dma_desc_pool;
                slot->async_tx.phys =
                        (dma_addr_t) &hw_desc[idx * MV_XOR_SLOT_SIZE];