浏览代码

dmaengine: initialize tx_list in dma_async_tx_descriptor_init

Centralize this common initialization (and one case where ipu_idmac is
duplicating ->chan initialization).

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams 16 年之前
父节点
当前提交
ccccce229c
共有 7 个文件被更改,包括 1 次插入7 次删除
  1. 1 0
      drivers/dma/dmaengine.c
  2. 0 1
      drivers/dma/dw_dmac.c
  3. 0 1
      drivers/dma/fsldma.c
  4. 0 1
      drivers/dma/ioat_dma.c
  5. 0 1
      drivers/dma/iop-adma.c
  6. 0 2
      drivers/dma/ipu/ipu_idmac.c
  7. 0 1
      drivers/dma/mv_xor.c

+ 1 - 0
drivers/dma/dmaengine.c

@@ -920,6 +920,7 @@ void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
 {
 {
 	tx->chan = chan;
 	tx->chan = chan;
 	spin_lock_init(&tx->lock);
 	spin_lock_init(&tx->lock);
+	INIT_LIST_HEAD(&tx->tx_list);
 }
 }
 EXPORT_SYMBOL(dma_async_tx_descriptor_init);
 EXPORT_SYMBOL(dma_async_tx_descriptor_init);
 
 

+ 0 - 1
drivers/dma/dw_dmac.c

@@ -826,7 +826,6 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan)
 		dma_async_tx_descriptor_init(&desc->txd, chan);
 		dma_async_tx_descriptor_init(&desc->txd, chan);
 		desc->txd.tx_submit = dwc_tx_submit;
 		desc->txd.tx_submit = dwc_tx_submit;
 		desc->txd.flags = DMA_CTRL_ACK;
 		desc->txd.flags = DMA_CTRL_ACK;
-		INIT_LIST_HEAD(&desc->txd.tx_list);
 		desc->txd.phys = dma_map_single(chan2parent(chan), &desc->lli,
 		desc->txd.phys = dma_map_single(chan2parent(chan), &desc->lli,
 				sizeof(desc->lli), DMA_TO_DEVICE);
 				sizeof(desc->lli), DMA_TO_DEVICE);
 		dwc_desc_put(dwc, desc);
 		dwc_desc_put(dwc, desc);

+ 0 - 1
drivers/dma/fsldma.c

@@ -354,7 +354,6 @@ static struct fsl_desc_sw *fsl_dma_alloc_descriptor(
 		dma_async_tx_descriptor_init(&desc_sw->async_tx,
 		dma_async_tx_descriptor_init(&desc_sw->async_tx,
 						&fsl_chan->common);
 						&fsl_chan->common);
 		desc_sw->async_tx.tx_submit = fsl_dma_tx_submit;
 		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;
 		desc_sw->async_tx.phys = pdesc;
 	}
 	}
 
 

+ 0 - 1
drivers/dma/ioat_dma.c

@@ -693,7 +693,6 @@ static struct ioat_desc_sw *ioat_dma_alloc_descriptor(
 		desc_sw->async_tx.tx_submit = ioat2_tx_submit;
 		desc_sw->async_tx.tx_submit = ioat2_tx_submit;
 		break;
 		break;
 	}
 	}
-	INIT_LIST_HEAD(&desc_sw->async_tx.tx_list);
 
 
 	desc_sw->hw = desc;
 	desc_sw->hw = desc;
 	desc_sw->async_tx.phys = phys;
 	desc_sw->async_tx.phys = phys;

+ 0 - 1
drivers/dma/iop-adma.c

@@ -498,7 +498,6 @@ static int iop_adma_alloc_chan_resources(struct dma_chan *chan)
 		slot->async_tx.tx_submit = iop_adma_tx_submit;
 		slot->async_tx.tx_submit = iop_adma_tx_submit;
 		INIT_LIST_HEAD(&slot->chain_node);
 		INIT_LIST_HEAD(&slot->chain_node);
 		INIT_LIST_HEAD(&slot->slot_node);
 		INIT_LIST_HEAD(&slot->slot_node);
-		INIT_LIST_HEAD(&slot->async_tx.tx_list);
 		hw_desc = (char *) iop_chan->device->dma_desc_pool;
 		hw_desc = (char *) iop_chan->device->dma_desc_pool;
 		slot->async_tx.phys =
 		slot->async_tx.phys =
 			(dma_addr_t) &hw_desc[idx * IOP_ADMA_SLOT_SIZE];
 			(dma_addr_t) &hw_desc[idx * IOP_ADMA_SLOT_SIZE];

+ 0 - 2
drivers/dma/ipu/ipu_idmac.c

@@ -983,8 +983,6 @@ static int idmac_desc_alloc(struct idmac_channel *ichan, int n)
 		memset(txd, 0, sizeof(*txd));
 		memset(txd, 0, sizeof(*txd));
 		dma_async_tx_descriptor_init(txd, &ichan->dma_chan);
 		dma_async_tx_descriptor_init(txd, &ichan->dma_chan);
 		txd->tx_submit		= idmac_tx_submit;
 		txd->tx_submit		= idmac_tx_submit;
-		txd->chan		= &ichan->dma_chan;
-		INIT_LIST_HEAD(&txd->tx_list);
 
 
 		list_add(&desc->list, &ichan->free_list);
 		list_add(&desc->list, &ichan->free_list);
 
 

+ 0 - 1
drivers/dma/mv_xor.c

@@ -632,7 +632,6 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
 		slot->async_tx.tx_submit = mv_xor_tx_submit;
 		slot->async_tx.tx_submit = mv_xor_tx_submit;
 		INIT_LIST_HEAD(&slot->chain_node);
 		INIT_LIST_HEAD(&slot->chain_node);
 		INIT_LIST_HEAD(&slot->slot_node);
 		INIT_LIST_HEAD(&slot->slot_node);
-		INIT_LIST_HEAD(&slot->async_tx.tx_list);
 		hw_desc = (char *) mv_chan->device->dma_desc_pool;
 		hw_desc = (char *) mv_chan->device->dma_desc_pool;
 		slot->async_tx.phys =
 		slot->async_tx.phys =
 			(dma_addr_t) &hw_desc[idx * MV_XOR_SLOT_SIZE];
 			(dma_addr_t) &hw_desc[idx * MV_XOR_SLOT_SIZE];