pci_client: do not set up interrupt routing when pci_register_driver_noirq is called
authorRoni Häcki <roni.haecki@inf.ethz.ch>
Wed, 25 Jan 2017 13:01:23 +0000 (14:01 +0100)
committerRoni Häcki <roni.haecki@inf.ethz.ch>
Wed, 25 Jan 2017 13:01:23 +0000 (14:01 +0100)
Signed-off-by: Roni Häcki <roni.haecki@inf.ethz.ch>

lib/pci/pci_client.c

index d8aba11..a60aa75 100644 (file)
@@ -217,9 +217,11 @@ errval_t pci_register_driver_movable_irq(pci_driver_init_fn init_func, uint32_t
 
     // Set-up int routing.
     PCI_CLIENT_DEBUG("Calling setup_int_routing\n");
-    err = setup_int_routing(0, handler, handler_arg, reloc_handler, reloc_handler_arg);
-    if(err_is_fail(err)){
-       DEBUG_ERR(err, "Could not set up int routing. Continuing w/o interrupts");
+    if (!(handler == NULL)) {
+        err = setup_int_routing(0, handler, handler_arg, reloc_handler, reloc_handler_arg);
+        if(err_is_fail(err)){
+           DEBUG_ERR(err, "Could not set up int routing. Continuing w/o interrupts");
+        }
     }
 
     // FIXME: leak