Messages in this thread | | | Date | Fri, 16 Sep 2011 11:01:10 +0530 | From | Viresh Kumar <> | Subject | Re: [PATCH] dmaengine: delete redundant chan_id and chancnt initialization in dma drivers |
| |
On 9/15/2011 3:36 PM, Barry Song wrote: > 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. > > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > index 4d180ca..9bfd6d3 100644 > --- a/drivers/dma/dw_dmac.c > +++ b/drivers/dma/dw_dmac.c > @@ -1407,12 +1407,11 @@ static int __init dw_probe(struct platform_device *pdev) > dw->all_chan_mask = (1 << pdata->nr_channels) - 1; > > 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]; > > dwc->chan.device = &dw->dma; > dwc->chan.cookie = dwc->completed = 1; > - dwc->chan.chan_id = i; > if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING) > list_add_tail(&dwc->chan.device_node, > &dw->dma.channels); > @@ -1468,7 +1467,7 @@ static int __init dw_probe(struct platform_device *pdev) > dma_writel(dw, CFG, DW_CFG_DMA_EN); > > 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); >
Acked-by: Viresh Kumar <viresh.kumar@st.com>
-- viresh
| |