]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/ppc: use pci_init_nic_devices()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 21 Oct 2023 20:43:33 +0000 (21:43 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 22 Oct 2023 13:29:55 +0000 (14:29 +0100)
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
hw/ppc/e500.c
hw/ppc/mac_newworld.c
hw/ppc/mac_oldworld.c
hw/ppc/ppc440_bamboo.c

index e04114fb3c7c0654dc79a98e397f05a659a1c3c5..f62eeb34117644f7ac5e7a1dc7758ec1f8cbbdff 100644 (file)
@@ -1075,9 +1075,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 */
index 535710314a5052321e35e80a9b94c273074ee049..b36dbaf2b681bbd9b0ce0082c550ee2fd29eaab7 100644 (file)
@@ -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) {
index 9acc7adfc925f8d9f4718d7febc484fb727e53c7..1981d3d8f6e95357ea3b758641318ea162685e8a 100644 (file)
@@ -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));
index 45f409c83862554f03612042223d339274597677..e63289144a05d1aebae8bf18ebfbcad24a04f4e6 100644 (file)
@@ -235,14 +235,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. */