Skip to content

Commit 6393ff1

Browse files
zonquegregkh
authored andcommitted
sc16is7xx: Use threaded IRQ
Use a threaded IRQ handler to get rid of the irq_work kthread. This also allows for the driver to use interrupts generated by a threaded controller. Signed-off-by: Daniel Mack <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 37f3965 commit 6393ff1

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ struct sc16is7xx_port {
327327
unsigned char buf[SC16IS7XX_FIFO_SIZE];
328328
struct kthread_worker kworker;
329329
struct task_struct *kworker_task;
330-
struct kthread_work irq_work;
331330
struct mutex efr_lock;
332331
struct sc16is7xx_one p[];
333332
};
@@ -710,9 +709,9 @@ static bool sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)
710709
return true;
711710
}
712711

713-
static void sc16is7xx_ist(struct kthread_work *ws)
712+
static irqreturn_t sc16is7xx_irq(int irq, void *dev_id)
714713
{
715-
struct sc16is7xx_port *s = to_sc16is7xx_port(ws, irq_work);
714+
struct sc16is7xx_port *s = (struct sc16is7xx_port *)dev_id;
716715

717716
mutex_lock(&s->efr_lock);
718717

@@ -727,13 +726,6 @@ static void sc16is7xx_ist(struct kthread_work *ws)
727726
}
728727

729728
mutex_unlock(&s->efr_lock);
730-
}
731-
732-
static irqreturn_t sc16is7xx_irq(int irq, void *dev_id)
733-
{
734-
struct sc16is7xx_port *s = (struct sc16is7xx_port *)dev_id;
735-
736-
kthread_queue_work(&s->kworker, &s->irq_work);
737729

738730
return IRQ_HANDLED;
739731
}
@@ -1221,7 +1213,6 @@ static int sc16is7xx_probe(struct device *dev,
12211213
mutex_init(&s->efr_lock);
12221214

12231215
kthread_init_worker(&s->kworker);
1224-
kthread_init_work(&s->irq_work, sc16is7xx_ist);
12251216
s->kworker_task = kthread_run(kthread_worker_fn, &s->kworker,
12261217
"sc16is7xx");
12271218
if (IS_ERR(s->kworker_task)) {
@@ -1303,8 +1294,9 @@ static int sc16is7xx_probe(struct device *dev,
13031294
}
13041295

13051296
/* Setup interrupt */
1306-
ret = devm_request_irq(dev, irq, sc16is7xx_irq,
1307-
IRQF_TRIGGER_FALLING, dev_name(dev), s);
1297+
ret = devm_request_threaded_irq(dev, irq, NULL, sc16is7xx_irq,
1298+
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
1299+
dev_name(dev), s);
13081300
if (!ret)
13091301
return 0;
13101302

0 commit comments

Comments
 (0)