Re: [PATCH 06/13] media: davinci: vpif: Use platform_get_irq_optional() to get the interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On Thu, Jan 6, 2022 at 2:15 PM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
>
> On Thu, Jan 6, 2022 at 3:43 PM Andy Shevchenko
> <andy.shevchenko@xxxxxxxxx> wrote:
> > On Wed, Jan 5, 2022 at 7:41 PM Lad, Prabhakar
> > <prabhakar.csengg@xxxxxxxxx> wrote:
> > > On Wed, Jan 5, 2022 at 9:43 AM Andy Shevchenko
> > > <andy.shevchenko@xxxxxxxxx> wrote:
> > > > On Tue, Jan 4, 2022 at 7:23 PM Lad, Prabhakar
> > > > <prabhakar.csengg@xxxxxxxxx> wrote:
> > > > > On Sat, Dec 25, 2021 at 5:32 PM Andy Shevchenko
> > > > > <andy.shevchenko@xxxxxxxxx> wrote:
> > > > > > On Sat, Dec 25, 2021 at 3:04 AM Lad Prabhakar
> > > > > > <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx> wrote:
>
> ...
>
> > > > > > > +       res_irq->flags = IORESOURCE_IRQ | irq_get_trigger_type(irq);
> > > > > > > +       res_irq->start = irq;
> > > > > > > +       res_irq->end = irq;
> > > > > > > +       res_irq->name = dev_of_node(&pdev->dev) ? of_node_full_name(pdev->dev.of_node) : NULL;
> > > > > >
> > > > > > If you convert DEFINE_RES_NAMED() to return a compound literal, then
> > > > > > you may use it here like
> > > > > >
> > > > > > res_irq = DEFINE_RES_NAMED(...);
> > > > > >
> > > > > > or even do like this
> > > > > >
> > > > > > if (dev_of_node(...))
> > > > > >   res_irq = DEFINE_RES_IRQ_NAMED(...)
> > > > > > else
> > > > > >   res_irq = DEFINE_RES_IRQ(...);
> > > > > > res_irq->flags |= irq_get_trigger_type(irq);
> > > > > >
> > > > > There are quite a few users of DEFINE_RES_IRQ_NAMED()/DEFINE_RES_IRQ()
> > > > > changing this macos just for this single user tree wide doesn't make
> > > > > sense. Let me know if you think otherwise.
> > > >
> > > > Converting them to produce compound literal is straightforward and
> > > > does not require changes in the users. But on the other hand it allows
> > > > you to use it and convert existing users to use that form directly.
> > > > You may conduct research on how macros in the property.h were morphing
> > > > towards that.
> > > >
> > > Thank you for the pointer. I did the below change for this.
> > >
> > > diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> > > index 8359c50f9988..da1208e8f164 100644
> > > --- a/include/linux/ioport.h
> > > +++ b/include/linux/ioport.h
> > > @@ -153,7 +153,7 @@ enum {
> > >
> > >  /* helpers to define resources */
> > >  #define DEFINE_RES_NAMED(_start, _size, _name, _flags)                 \
> > > -       {                                                               \
> > > +       (struct resource) {                                     \
> >
> > Yep, that's it.
> >
> > >                 .start = (_start),                                      \
> > >                 .end = (_start) + (_size) - 1,                          \
> > >                 .name = (_name),                                        \
> > >
> > > But there are some instances which need to be touched, for example
> > > vexpress-sysreg.c [1]. Are you OK with files to be changed?
> >
> > Nice! That's exactly my point and you can sell it to the community
> > because there are already users of it like this.
> >
> > Yes, I'm fine, but it seems it needs to be done treewide in one patch.
> > Btw, how many of those already in use?
>
> Actually you don't need to change that. It's an array of resources and
> everything should be kept as is there.
>
I do get below build failures, with the above literal change for
vexpress-sysreg.c.

drivers/mfd/vexpress-sysreg.c: At top level:
drivers/mfd/vexpress-sysreg.c:64:37: error: initialiser element is not constant
   64 |   .resources = (struct resource []) {
      |                                     ^
drivers/mfd/vexpress-sysreg.c:64:37: note: (near initialisation for
‘vexpress_sysreg_cells[0]’)
drivers/mfd/vexpress-sysreg.c:73:37: error: initialiser element is not constant
   73 |   .resources = (struct resource []) {
      |                                     ^
drivers/mfd/vexpress-sysreg.c:73:37: note: (near initialisation for
‘vexpress_sysreg_cells[1]’)
drivers/mfd/vexpress-sysreg.c:82:37: error: initialiser element is not constant
   82 |   .resources = (struct resource []) {
      |                                     ^
drivers/mfd/vexpress-sysreg.c:82:37: note: (near initialisation for
‘vexpress_sysreg_cells[2]’)
drivers/mfd/vexpress-sysreg.c:90:37: error: initialiser element is not constant
   90 |   .resources = (struct resource []) {
      |                                     ^
drivers/mfd/vexpress-sysreg.c:90:37: note: (near initialisation for
‘vexpress_sysreg_cells[3]’)
drivers/mfd/vexpress-sysreg.c:93:2: warning: missing initialiser for
field ‘ignore_resource_conflicts’ of ‘struct mfd_cell’
[-Wmissing-field-initializers]
   93 |  }

Cheers,
Prabhakar




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux