summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/emulation/qemu-i440fx/mainboard.c7
-rw-r--r--src/mainboard/emulation/qemu-q35/mainboard.c14
2 files changed, 15 insertions, 6 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/mainboard.c b/src/mainboard/emulation/qemu-i440fx/mainboard.c
index 218c47f0aa..a7c6b32598 100644
--- a/src/mainboard/emulation/qemu-i440fx/mainboard.c
+++ b/src/mainboard/emulation/qemu-i440fx/mainboard.c
@@ -24,8 +24,11 @@ static void qemu_nb_init(struct device *dev)
pc_keyboard_init(NO_AUX_DEVICE);
/* setup IRQ routing */
- for (i = 0; i < 32; i++)
- pci_assign_irqs(pcidev_on_root(i, 0), qemu_i440fx_irqs + (i % 4));
+ for (i = 0; i < 32; i++) {
+ struct device *d = pcidev_on_root(i, 0);
+ if (d)
+ pci_assign_irqs(d, qemu_i440fx_irqs + (i % 4));
+ }
}
static void qemu_nb_read_resources(struct device *dev)
diff --git a/src/mainboard/emulation/qemu-q35/mainboard.c b/src/mainboard/emulation/qemu-q35/mainboard.c
index e53404d55c..534f6061a1 100644
--- a/src/mainboard/emulation/qemu-q35/mainboard.c
+++ b/src/mainboard/emulation/qemu-q35/mainboard.c
@@ -31,11 +31,17 @@ static void qemu_nb_init(struct device *dev)
pc_keyboard_init(NO_AUX_DEVICE);
/* setup IRQ routing for pci slots */
- for (i = 0; i < 25; i++)
- pci_assign_irqs(pcidev_on_root(i, 0), qemu_q35_irqs + (i % 4));
+ for (i = 0; i < 25; i++) {
+ struct device *d = pcidev_on_root(i, 0);
+ if (d)
+ pci_assign_irqs(d, qemu_q35_irqs + (i % 4));
+ }
/* setup IRQ routing southbridge devices */
- for (i = 25; i < 32; i++)
- pci_assign_irqs(pcidev_on_root(i, 0), qemu_q35_irqs);
+ for (i = 25; i < 32; i++) {
+ struct device *d = pcidev_on_root(i, 0);
+ if (d)
+ pci_assign_irqs(d, qemu_q35_irqs);
+ }
}
static void qemu_nb_read_resources(struct device *dev)