From f138ed5e005db9d8ce1eb511bea7c9da4333da76 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 23 Oct 2023 09:37:36 +0100 Subject: hw/net/lan9118: use qemu_configure_nic_device() Some callers instantiate the device unconditionally, others will do so only if there is a NICInfo to go with it. This appears to be fairly random, but preseve the existing behaviour for now. Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/vexpress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/arm/vexpress.c') diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index f1b45245d5..e5fb3ab1f9 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -679,8 +679,8 @@ static void vexpress_common_init(MachineState *machine) memory_region_add_subregion(sysmem, map[VE_VIDEORAM], &vms->vram); /* 0x4e000000 LAN9118 Ethernet */ - if (nd_table[0].used) { - lan9118_init(&nd_table[0], map[VE_ETHERNET], pic[15]); + if (qemu_find_nic_info("lan9118", true, NULL)) { + lan9118_init(map[VE_ETHERNET], pic[15]); } /* VE_USB: not modelled */ -- cgit 1.4.1