[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200528151902.vemr7aolvtean2f3@mobilestation>
Date: Thu, 28 May 2020 18:19:02 +0300
From: Serge Semin <Sergey.Semin@...kalelectronics.ru>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: Serge Semin <fancer.lancer@...il.com>,
Vinod Koul <vkoul@...nel.org>,
Viresh Kumar <vireshk@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Arnd Bergmann <arnd@...db.de>,
Rob Herring <robh+dt@...nel.org>, <linux-mips@...r.kernel.org>,
<devicetree@...r.kernel.org>, <dmaengine@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 05/10] dmaengine: Introduce DMA-device device_caps
callback
On Thu, May 28, 2020 at 05:42:57PM +0300, Andy Shevchenko wrote:
> On Wed, May 27, 2020 at 01:50:16AM +0300, Serge Semin wrote:
> > There are DMA devices (like ours version of Synopsys DW DMAC) which have
> > DMA capabilities non-uniformly redistributed amongst the device channels.
> > In order to provide a way of exposing the channel-specific parameters to
> > the DMA engine consumers, we introduce a new DMA-device callback. In case
> > if provided it gets called from the dma_get_slave_caps() method and is
> > able to override the generic DMA-device capabilities.
>
> > + if (device->device_caps)
> > + device->device_caps(chan, caps);
> > +
> > return 0;
>
> I dunno why this returns int, but either we get rid of this returned value
> (perhaps in the future, b/c it's not directly related to this series), or
> something like
>
> if (device->device_caps)
> return device->device_caps(chan, caps);
It returns int because dma_get_slave_caps() check parameters and some other
stuff.
Regarding device_caps() callback having a return value. IMO it's redundant.
The only thing what the callback should do is to update the caps and device
is supposed to know it' capabilities, otherwise who else should know? So I
don't see why device_caps would be needed.
-Sergey
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Powered by blists - more mailing lists