Forráskód Böngészése

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
Yo-Jung Lin 1 éve
szülő
commit
0c3aaac3c1
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      examples/bh_threaded.c

+ 2 - 2
examples/bh_threaded.c

@@ -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);