On 01/28/2013 12:01 PM, Arnd Bergmann wrote: > On Monday 28 January 2013, Jon Hunter wrote: >> On 01/28/2013 08:51 AM, Arnd Bergmann wrote: >>> On Friday 18 January 2013, Padmavathi Venna wrote: >>>> + pfi = devm_kzalloc(&adev->dev, sizeof(*pfi), GFP_KERNEL); >>>> + if (!pfi) { >>>> + dev_err(&adev->dev, "unable to allocate mem\n"); >>>> + return -ENOMEM; >>>> + } >>>> + >>>> + pfi->dma_cap = pd->cap_mask; >>>> + pfi->filter_fn = pl330_filter; >>>> + >>>> + ret = of_dma_controller_register(adev->dev.of_node, >>>> + of_dma_pl330_xlate, pfi); >>> >>> Why do you pass a 'struct of_dma_filter_info' here? I would >>> expect that you pass the pdmac object as the third argument. >> >> I believe it is because that is the data that the xlate function is >> using. Are you suggesting the data should be stored in the pdmac object >> and extracted from there? That could be done too given that this >> controller has its own xlate. > > It just seems weird that we are passing a constant cap_mask in > a data structure, and that we need our own filter function still, > but don't pass the pointer to the data structure that we actually > need in the filter function (the dma_device *).
Gotcha. I was still thinking about the generic case, but in this case if you know the dma controller, it is redundant. Cheers Jon _______________________________________________ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss