aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2023-10-23 09:37:19 +0100
committerDavid Woodhouse <dwmw@amazon.co.uk>2024-02-02 16:23:47 +0000
commit36b6968d3408b779d32eedb0fb11a4b6b828a0b2 (patch)
treedf850c9ac11984bf6ae80224be872e966d5f6de0
parent0aff81618bedcd2f60d83da4f743da4902638be6 (diff)
downloadqemu-36b6968d3408b779d32eedb0fb11a4b6b828a0b2.zip
qemu-36b6968d3408b779d32eedb0fb11a4b6b828a0b2.tar.gz
qemu-36b6968d3408b779d32eedb0fb11a4b6b828a0b2.tar.bz2
hw/ppc: use pci_init_nic_devices()
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--hw/ppc/e500.c4
-rw-r--r--hw/ppc/mac_newworld.c4
-rw-r--r--hw/ppc/mac_oldworld.c4
-rw-r--r--hw/ppc/ppc440_bamboo.c14
4 files changed, 8 insertions, 18 deletions
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 566f120..3bd12b5 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -1079,9 +1079,7 @@ void ppce500_init(MachineState *machine)
if (pci_bus) {
/* Register network interfaces. */
- for (i = 0; i < nb_nics; i++) {
- pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL);
- }
+ pci_init_nic_devices(pci_bus, mc->default_nic);
}
/* Register spinning region */
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 5357103..b36dbaf 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -444,9 +444,7 @@ static void ppc_core99_init(MachineState *machine)
graphic_depth = 15;
}
- for (i = 0; i < nb_nics; i++) {
- pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL);
- }
+ pci_init_nic_devices(pci_bus, mc->default_nic);
/* The NewWorld NVRAM is not located in the MacIO device */
if (kvm_enabled() && qemu_real_host_page_size() > 4096) {
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 9acc7ad..1981d3d 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -277,9 +277,7 @@ static void ppc_heathrow_init(MachineState *machine)
pci_vga_init(pci_bus);
- for (i = 0; i < nb_nics; i++) {
- pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL);
- }
+ pci_init_nic_devices(pci_bus, mc->default_nic);
/* MacIO IDE */
ide_drive_get(hd, ARRAY_SIZE(hd));
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index a189942..c75c308 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -161,7 +161,6 @@ static void bamboo_init(MachineState *machine)
DeviceState *uicdev;
SysBusDevice *uicsbd;
int success;
- int i;
if (kvm_enabled()) {
error_report("machine %s does not support the KVM accelerator",
@@ -234,14 +233,11 @@ static void bamboo_init(MachineState *machine)
}
if (pcibus) {
- /* Register network interfaces. */
- for (i = 0; i < nb_nics; i++) {
- /*
- * There are no PCI NICs on the Bamboo board, but there are
- * PCI slots, so we can pick whatever default model we want.
- */
- pci_nic_init_nofail(&nd_table[i], pcibus, mc->default_nic, NULL);
- }
+ /*
+ * There are no PCI NICs on the Bamboo board, but there are
+ * PCI slots, so we can pick whatever default model we want.
+ */
+ pci_init_nic_devices(pcibus, mc->default_nic);
}
/* Load kernel. */