Re: [PATCH] dmaengine: pl330: make platform data optional

From: Jassi Brar
Date: Mon Jul 25 2011 - 11:03:30 EST


On Mon, Jul 25, 2011 at 7:54 PM, Vinod Koul <vkoul@xxxxxxxxxxxxx> wrote:
> On Tue, 2011-07-12 at 20:00 -0500, Rob Herring wrote:
>> From: Rob Herring <rob.herring@xxxxxxxxxxx>
>>
>> The pl330 needs platform data for describing peripheral connections, but
>> some platforms may only support memory to memory dma channels. In this
>> case, we can probe for how many channels there are and don't need the
>> platform data.
>>
>> As memcpy requests don't need channel private data to hold peripheral
>> info, allow private data to be NULL in this case.
>>
>> Signed-off-by: Rob Herring <rob.herring@xxxxxxxxxxx>
>> Cc: Jassi Brar <jassi.brar@xxxxxxxxxxx>
>> Cc: Vinod Koul <vinod.koul@xxxxxxxxx>
>> Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
>> ---
>> Âdrivers/dma/pl330.c | Â 64 ++++++++++++++++++++++++++++----------------------
>> Â1 files changed, 36 insertions(+), 28 deletions(-)
> Applied, Thanks

Oops, sorry Rob. I failed to reply as I assured you. I have been just
too deep into other stuff.

>> @@ -717,27 +717,35 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
>> Â Â Â INIT_LIST_HEAD(&pd->channels);
>>
>> Â Â Â /* Initialize channel parameters */
>> - Â Â for (i = 0; i < pdat->nr_valid_peri; i++) {
>> - Â Â Â Â Â Â struct dma_pl330_peri *peri = &pdat->peri[i];
>> - Â Â Â Â Â Â pch = &pdmac->peripherals[i];
>> + Â Â num_chan = max(pdat->nr_valid_peri, (u8)pi->pcfg.num_chan);
Perhaps you need to check against NULL pointer on 'pdat' ?

Rest looks ok.

thnx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/