Skip to content

Commit 0c3aaac

Browse files
0xff07jserv
authored andcommitted
Pass proper cookies to the request_threaded_irq
The last parameter of request_threaded_irq must be a globally unique cookie[1]. Usually this would be the device struct received by probe(). Since we are not using driver model, pass the gpio structs instead. [1] https://docs.kernel.org/core-api/genericirq.html
1 parent 65397e2 commit 0c3aaac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/bh_threaded.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static int __init bottomhalf_init(void)
8181

8282
ret = request_threaded_irq(
8383
button_irqs[0], button_top_half, button_bottom_half,
84-
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button1", NULL);
84+
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button1", &buttons[0]);
8585

8686
if (ret) {
8787
pr_err("Unable to request IRQ: %d\n", ret);
@@ -101,7 +101,7 @@ static int __init bottomhalf_init(void)
101101

102102
ret = request_threaded_irq(
103103
button_irqs[1], button_top_half, button_bottom_half,
104-
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button2", NULL);
104+
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button2", &buttons[1]);
105105

106106
if (ret) {
107107
pr_err("Unable to request IRQ: %d\n", ret);

0 commit comments

Comments
 (0)