lkml.org 
[lkml]   [2021]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] gpio: tqmx86: really make IRQ optional
From
Date
On Wed, 2021-03-31 at 15:39 +0300, Andy Shevchenko wrote:
> On Wed, Mar 31, 2021 at 3:37 PM Matthias Schiffer
> <matthias.schiffer@ew.tq-group.com> wrote:
> > On Wed, 2021-03-31 at 15:29 +0300, Andy Shevchenko wrote:
> > > On Wed, Mar 31, 2021 at 2:37 PM Matthias Schiffer
> > > <matthias.schiffer@ew.tq-group.com> wrote:
>
> ...
>
> > > > - irq = platform_get_irq(pdev, 0);
> > > > - if (irq < 0)
> > > > + irq = platform_get_irq_optional(pdev, 0);
> > > > + if (irq < 0 && irq != -ENXIO)
> > > > return irq;
> > >
> > > This is a dead code now. I suggest you to do the opposite, i.e.
> > > if (irq < 0)
> > > irq = 0;
> >
> > I don't understand which part of the code is dead now. I assume the
> > `return irq` case is still useful for unexpected errors, or things like
> > EPROBE_DEFER? I'm not sure if EPROBE_DEFER is relevant for this driver,
> > but just ignoring the error code completely doesn't seem right to me.
>
> platform_get_irq() AFAIK won't ever return such a code.
> So, basically your conditional is always false.
>
> I would like to see the code path which makes my comment wrong.
>

EPROBE_DEFER appears a few times in platform_get_irq_optional()
(drivers/base/platform.c), but it's possible that this is only relevant
for OF-based platforms and not x86.

\
 
 \ /
  Last update: 2021-03-31 15:39    [W:0.582 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site