lkml.org 
[lkml]   [2021]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 1/3] dmaengine: ptdma: Initial driver for the AMD PTDMA
On Wed, Jun 16, 2021 at 10:24:52AM +0530, Sanjay R Mehta wrote:
>
>
> On 6/16/2021 9:45 AM, Vinod Koul wrote:
> > [CAUTION: External Email]
> >
> > On 15-06-21, 16:50, Sanjay R Mehta wrote:
> >
> >>>> +static struct pt_device *pt_alloc_struct(struct device *dev)
> >>>> +{
> >>>> + struct pt_device *pt;
> >>>> +
> >>>> + pt = devm_kzalloc(dev, sizeof(*pt), GFP_KERNEL);
> >>>> +
> >>>> + if (!pt)
> >>>> + return NULL;
> >>>> + pt->dev = dev;
> >>>> + pt->ord = atomic_inc_return(&pt_ordinal);
> >>>
> >>> What is the use of this number?
> >>>
> >>
> >> There are eight similar instances of this DMA engine on AMD SOC.
> >> It is to differentiate each of these instances.
> >
> > Are they individual device objects?
> >
>
> Yes, they are individual device objects.

Then what is "ord" for? Why are you using an atomic variable for this?
What does this field do? Why doesn't the normal way of naming a device
come into play here instead?

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-06-16 08:16    [W:0.011 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site