Thread (3 messages) 3 messages, 2 authors, 2021-12-17

Re: [PATCH v1 1/1] serial: 8520_mtk: Prepare for platform_get_irq_optional() changes

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-12-17 16:55:01
Also in: linux-arm-kernel, linux-mediatek, lkml

On Fri, Dec 17, 2021 at 05:10:34PM +0200, Andy Shevchenko wrote:
The platform_get_irq_optional() is going to be changed in a way
that the result of it:
   = 0 means no IRQ is provided
   < 0 means the error which needs to be propagated to the upper layers
   > 0 valid vIRQ is allocated
What about 0 being a valid irq?
In this case, drop check for 0. Note, the 0 is not valid vIRQ and
platform_get_irq_optional() issues a big WARN() in such case,
But it still is a valid irq, so why did you just break things?  Yes, a
warning will happen, but the driver and platform will still work.
quoted hunk ↗ jump to hunk
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_mtk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index fb65dc601b23..8d3e16d7bf63 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -641,7 +641,7 @@ static int __maybe_unused mtk8250_resume(struct device *dev)
 	struct mtk8250_data *data = dev_get_drvdata(dev);
 	int irq = data->rx_wakeup_irq;
 
-	if (irq >= 0)
+	if (irq > 0)
 		disable_irq_wake(irq);
Why change this now?  What does this solve at this point in time?

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help