Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46389470 authored by Barry Song's avatar Barry Song Committed by Vinod Koul
Browse files

dmaengine: delete redundant chan_id and chancnt initialization in dma drivers



dma_async_device_register will re-init chan_id and chancnt,
so whatever chan_id and chancnt are set in drivers, they will
be re-written by dma_async_device_register.

Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Viresh Kumar <viresh.kumar@st.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Piotr Ziecik <kosmo@semihalf.com>
Cc: Yong Wang <yong.y.wang@intel.com>
Cc: Jaswinder Singh <jassi.brar@samsung.com>
Cc: Pelagicore AB <info@pelagicore.com>
Signed-off-by: default avatarBarry Song <Baohua.Song@csr.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@st.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent c1205646
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -1268,12 +1268,11 @@ static int __init at_dma_probe(struct platform_device *pdev)


	/* initialize channels related values */
	/* initialize channels related values */
	INIT_LIST_HEAD(&atdma->dma_common.channels);
	INIT_LIST_HEAD(&atdma->dma_common.channels);
	for (i = 0; i < pdata->nr_channels; i++, atdma->dma_common.chancnt++) {
	for (i = 0; i < pdata->nr_channels; i++) {
		struct at_dma_chan	*atchan = &atdma->chan[i];
		struct at_dma_chan	*atchan = &atdma->chan[i];


		atchan->chan_common.device = &atdma->dma_common;
		atchan->chan_common.device = &atdma->dma_common;
		atchan->chan_common.cookie = atchan->completed_cookie = 1;
		atchan->chan_common.cookie = atchan->completed_cookie = 1;
		atchan->chan_common.chan_id = i;
		list_add_tail(&atchan->chan_common.device_node,
		list_add_tail(&atchan->chan_common.device_node,
				&atdma->dma_common.channels);
				&atdma->dma_common.channels);


@@ -1314,7 +1313,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
	dev_info(&pdev->dev, "Atmel AHB DMA Controller ( %s%s), %d channels\n",
	dev_info(&pdev->dev, "Atmel AHB DMA Controller ( %s%s), %d channels\n",
	  dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask) ? "cpy " : "",
	  dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask) ? "cpy " : "",
	  dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask)  ? "slave " : "",
	  dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask)  ? "slave " : "",
	  atdma->dma_common.chancnt);
	  pdata->nr_channels);


	dma_async_device_register(&atdma->dma_common);
	dma_async_device_register(&atdma->dma_common);


+2 −3
Original line number Original line Diff line number Diff line
@@ -1407,12 +1407,11 @@ static int __init dw_probe(struct platform_device *pdev)
	dw->all_chan_mask = (1 << pdata->nr_channels) - 1;
	dw->all_chan_mask = (1 << pdata->nr_channels) - 1;


	INIT_LIST_HEAD(&dw->dma.channels);
	INIT_LIST_HEAD(&dw->dma.channels);
	for (i = 0; i < pdata->nr_channels; i++, dw->dma.chancnt++) {
	for (i = 0; i < pdata->nr_channels; i++) {
		struct dw_dma_chan	*dwc = &dw->chan[i];
		struct dw_dma_chan	*dwc = &dw->chan[i];


		dwc->chan.device = &dw->dma;
		dwc->chan.device = &dw->dma;
		dwc->chan.cookie = dwc->completed = 1;
		dwc->chan.cookie = dwc->completed = 1;
		dwc->chan.chan_id = i;
		if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING)
		if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING)
			list_add_tail(&dwc->chan.device_node,
			list_add_tail(&dwc->chan.device_node,
					&dw->dma.channels);
					&dw->dma.channels);
@@ -1468,7 +1467,7 @@ static int __init dw_probe(struct platform_device *pdev)
	dma_writel(dw, CFG, DW_CFG_DMA_EN);
	dma_writel(dw, CFG, DW_CFG_DMA_EN);


	printk(KERN_INFO "%s: DesignWare DMA Controller, %d channels\n",
	printk(KERN_INFO "%s: DesignWare DMA Controller, %d channels\n",
			dev_name(&pdev->dev), dw->dma.chancnt);
			dev_name(&pdev->dev), pdata->nr_channels);


	dma_async_device_register(&dw->dma);
	dma_async_device_register(&dw->dma);


+0 −2
Original line number Original line Diff line number Diff line
@@ -1114,7 +1114,6 @@ static int mid_setup_dma(struct pci_dev *pdev)


		midch->chan.device = &dma->common;
		midch->chan.device = &dma->common;
		midch->chan.cookie =  1;
		midch->chan.cookie =  1;
		midch->chan.chan_id = i;
		midch->ch_id = dma->chan_base + i;
		midch->ch_id = dma->chan_base + i;
		pr_debug("MDMA:Init CH %d, ID %d\n", i, midch->ch_id);
		pr_debug("MDMA:Init CH %d, ID %d\n", i, midch->ch_id);


@@ -1150,7 +1149,6 @@ static int mid_setup_dma(struct pci_dev *pdev)
	dma_cap_set(DMA_SLAVE, dma->common.cap_mask);
	dma_cap_set(DMA_SLAVE, dma->common.cap_mask);
	dma_cap_set(DMA_PRIVATE, dma->common.cap_mask);
	dma_cap_set(DMA_PRIVATE, dma->common.cap_mask);
	dma->common.dev = &pdev->dev;
	dma->common.dev = &pdev->dev;
	dma->common.chancnt = dma->max_chan;


	dma->common.device_alloc_chan_resources =
	dma->common.device_alloc_chan_resources =
					intel_mid_dma_alloc_chan_resources;
					intel_mid_dma_alloc_chan_resources;
+0 −1
Original line number Original line Diff line number Diff line
@@ -741,7 +741,6 @@ static int __devinit mpc_dma_probe(struct platform_device *op)
		mchan = &mdma->channels[i];
		mchan = &mdma->channels[i];


		mchan->chan.device = dma;
		mchan->chan.device = dma;
		mchan->chan.chan_id = i;
		mchan->chan.cookie = 1;
		mchan->chan.cookie = 1;
		mchan->completed_cookie = mchan->chan.cookie;
		mchan->completed_cookie = mchan->chan.cookie;


+0 −2
Original line number Original line Diff line number Diff line
@@ -926,7 +926,6 @@ static int __devinit pch_dma_probe(struct pci_dev *pdev,
	}
	}


	pd->dma.dev = &pdev->dev;
	pd->dma.dev = &pdev->dev;
	pd->dma.chancnt = nr_channels;


	INIT_LIST_HEAD(&pd->dma.channels);
	INIT_LIST_HEAD(&pd->dma.channels);


@@ -935,7 +934,6 @@ static int __devinit pch_dma_probe(struct pci_dev *pdev,


		pd_chan->chan.device = &pd->dma;
		pd_chan->chan.device = &pd->dma;
		pd_chan->chan.cookie = 1;
		pd_chan->chan.cookie = 1;
		pd_chan->chan.chan_id = i;


		pd_chan->membase = &regs->desc[i];
		pd_chan->membase = &regs->desc[i];


Loading