Thread (20 messages) 20 messages, 3 authors, 2021-06-27

Re: (EXT) Re: [PATCH 1/3] gpio: tqmx86: really make IRQ optional

From: Matthias Schiffer <hidden>
Date: 2021-03-31 12:37:55
Also in: lkml

On Wed, 2021-03-31 at 15:29 +0300, Andy Shevchenko wrote:
On Wed, Mar 31, 2021 at 2:37 PM Matthias Schiffer
[off-list ref] wrote:
quoted
The tqmx86 MFD driver was passing IRQ 0 for "no IRQ" in the past. This
causes warnings with newer kernels.

Prepare the gpio-tqmx86 driver for the fixed MFD driver by handling a
missing IRQ properly.
...
quoted
-       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.


In such a case below change is not required.

...
quoted
-       if (irq) {
+       if (irq > 0) {
                struct irq_chip *irq_chip = &gpio->irq_chip;
                u8 irq_status;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help