Skip to content

Commit e8ed246

Browse files
systec-awegregkh
authored andcommitted
serial: sc16is7xx: Fix IRQ number check behavior
The logical meaning of the previous version is wrong due to a typo. If the IRQ equals 0, no interrupt pin is available and polling mode shall be used. Additionally, this fix adds a check for IRQ < 0 to increase robustness, because documentation still says that negative IRQ values cannot be absolutely ruled-out. Fixes: 104c1b9 ("serial: sc16is7xx: Add polling mode if no IRQ pin is available") Signed-off-by: Andre Werner <andre.werner@systec-electronic.com> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Maarten Brock <maarten.brock@sttls.nl> Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20250121071819.1346672-1-andre.werner@systec-electronic.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2014c95 commit e8ed246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype,
15611561
/* Always ask for fixed clock rate from a property. */
15621562
device_property_read_u32(dev, "clock-frequency", &uartclk);
15631563

1564-
s->polling = !!irq;
1564+
s->polling = (irq <= 0);
15651565
if (s->polling)
15661566
dev_dbg(dev,
15671567
"No interrupt pin definition, falling back to polling mode\n");

0 commit comments

Comments
 (0)