[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve5Rf6ioYFULLGLWTaGdWNQikaPAFOoWjwXxmCbJ7tsyQ@mail.gmail.com>
Date: Thu, 28 May 2020 23:34:52 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
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 <devicetree@...r.kernel.org>,
dmaengine <dmaengine@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 05/10] dmaengine: Introduce DMA-device device_caps callback
On Thu, May 28, 2020 at 6:23 PM Serge Semin
<Sergey.Semin@...kalelectronics.ru> wrote:
> 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:
...
> > > + 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.
It might be useful in some (weird?) cases, when you would like to
override a parameter which device provides to relax it (my common
sense tells me that device on global level should not be restrictive,
rather permissive), which might be considered as an error (we would
like to set return capability out of the boundaries of global ones
which provided on device level).
But okay, up to you and Vinod.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists