@@ -868,10 +868,12 @@ static void sc16is7xx_poll_proc(struct kthread_work *ws)
{
struct sc16is7xx_port *s = container_of(ws, struct sc16is7xx_port, poll_work.work);
- /* Reuse standard IRQ handler. Interrupt ID is unused in this context. */
+ /*
+ * Reuse standard IRQ handler. Interrupt ID is unused in this
+ * context and set to zero.
+ */
sc16is7xx_irq(0, s);
- /* Setup delay based on SC16IS7XX_POLL_PERIOD_MS */
kthread_queue_delayed_work(&s->kworker, &s->poll_work,
msecs_to_jiffies(SC16IS7XX_POLL_PERIOD_MS));
}
@@ -1561,7 +1563,7 @@ int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype,
/* Always ask for fixed clock rate from a property. */
device_property_read_u32(dev, "clock-frequency", &uartclk);
- s->polling = !!irq;
+ s->polling = (irq <= 0);
if (s->polling)
dev_dbg(dev,
"No interrupt pin definition, falling back to polling mode\n");
@@ -1694,7 +1696,7 @@ int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype,
#endif
if (s->polling) {
- /* Initialize kernel thread for polling */
+ /* Initialize a kthread work struct that is dedicated to polling */
kthread_init_delayed_work(&s->poll_work, sc16is7xx_poll_proc);
return 0;
}