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
This commit is contained in:
Yo-Jung Lin 2024-04-19 23:53:27 +08:00 committed by Jim Huang
parent 65397e2d53
commit 0c3aaac3c1

View File

@ -81,7 +81,7 @@ static int __init bottomhalf_init(void)
ret = request_threaded_irq(
button_irqs[0], button_top_half, button_bottom_half,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button1", NULL);
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button1", &buttons[0]);
if (ret) {
pr_err("Unable to request IRQ: %d\n", ret);
@ -101,7 +101,7 @@ static int __init bottomhalf_init(void)
ret = request_threaded_irq(
button_irqs[1], button_top_half, button_bottom_half,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button2", NULL);
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpiomod#button2", &buttons[1]);
if (ret) {
pr_err("Unable to request IRQ: %d\n", ret);