Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread viresh kumar
On Mon, Nov 12, 2012 at 4:53 PM, Andy Shevchenko wrote: > + if (!pdata && autocfg) > + pdata = _dma_pdata; > + > + if (!pdata || pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) > + return -EINVAL; > + Another thing: replace the second if with else if :) --

Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread Viresh Kumar
On 12 November 2012 19:28, Andy Shevchenko wrote: > On Mon, 2012-11-12 at 19:24 +0530, viresh kumar wrote: >> Allocate it dynamically to support multiple controllers with different >> configuration >> in a SoC. > > Like you did for device tree? No problem, but here is the question: what > the

Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread Andy Shevchenko
On Mon, 2012-11-12 at 19:24 +0530, viresh kumar wrote: > On Mon, Nov 12, 2012 at 4:53 PM, Andy Shevchenko > wrote: > > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > > > static int __devinit dw_probe(struct platform_device *pdev) > > { > > struct dw_dma_platform_data

Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread viresh kumar
On Mon, Nov 12, 2012 at 4:53 PM, Andy Shevchenko wrote: > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > static int __devinit dw_probe(struct platform_device *pdev) > { > struct dw_dma_platform_data *pdata; > @@ -1604,9 +1610,6 @@ static int __devinit dw_probe(struct

[PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread Andy Shevchenko
The patch allows to probe the device when platform data is absent and hardware auto configuration is enabled. In that case the default platform data is used where the channel allocation order is set to ascending, channel priority is set to ascending, and private property is set to true.

[PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread Andy Shevchenko
The patch allows to probe the device when platform data is absent and hardware auto configuration is enabled. In that case the default platform data is used where the channel allocation order is set to ascending, channel priority is set to ascending, and private property is set to true.

Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread viresh kumar
On Mon, Nov 12, 2012 at 4:53 PM, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c static int __devinit dw_probe(struct platform_device *pdev) { struct dw_dma_platform_data *pdata; @@ -1604,9 +1610,6 @@ static int

Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread Andy Shevchenko
On Mon, 2012-11-12 at 19:24 +0530, viresh kumar wrote: On Mon, Nov 12, 2012 at 4:53 PM, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c static int __devinit dw_probe(struct platform_device *pdev) { struct

Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread Viresh Kumar
On 12 November 2012 19:28, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: On Mon, 2012-11-12 at 19:24 +0530, viresh kumar wrote: Allocate it dynamically to support multiple controllers with different configuration in a SoC. Like you did for device tree? No problem, but here is the

Re: [PATCH] dw_dmac: absence of pdata isn't critical when autocfg is set

2012-11-12 Thread viresh kumar
On Mon, Nov 12, 2012 at 4:53 PM, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: + if (!pdata autocfg) + pdata = dw_dma_pdata; + + if (!pdata || pdata-nr_channels DW_DMA_MAX_NR_CHANNELS) + return -EINVAL; + Another thing: replace the