[OpenBIOS] [PATCH 09/13] pci: don't set interrupt-map and interrupt-map-mask properties if empty

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Jul 8 22:35:56 CEST 2017


Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 drivers/pci.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/pci.c b/drivers/pci.c
index e2ab0e1..e3b2181 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -1772,13 +1772,16 @@ static void ob_pci_bus_set_interrupt_map(phandle_t pcibus, phandle_t dnode,
         fword("peer");
         pci_childnode = POP();
     }
-    set_property(pcibus, "interrupt-map", (char *)props, ncells * sizeof(props[0]));
 
-    props[0] = 0x00fff800;
-    props[1] = 0x0;
-    props[2] = 0x0;
-    props[3] = 0x7;
-    set_property(pcibus, "interrupt-map-mask", (char *)props, 4 * sizeof(props[0]));
+    if (ncells) {
+        set_property(pcibus, "interrupt-map", (char *)props, ncells * sizeof(props[0]));
+
+        props[0] = 0x00fff800;
+        props[1] = 0x0;
+        props[2] = 0x0;
+        props[3] = 0x7;
+        set_property(pcibus, "interrupt-map-mask", (char *)props, 4 * sizeof(props[0]));
+    }
 }
 
 int ob_pci_init(void)
-- 
1.7.10.4




More information about the OpenBIOS mailing list