diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-02-14 09:17:35 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-02-22 12:47:40 +0100 |
commit | 58183abfe702e4fe7654af8dd42c1270084486a3 (patch) | |
tree | e1a8061ab633c6de6cc0c9c30fe7241e22440c74 /hw/i386/pc_sysfw.c | |
parent | cb05cc16029bb0a61ac5279ab7b3b90dcf2aa69f (diff) |
hw/i386/pc_sysfw: Use qdev_is_realized() instead of QOM API
Prefer QDev API for QDev objects, avoid the underlying QOM layer.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20240216110313.17039-3-philmd@linaro.org>
Diffstat (limited to 'hw/i386/pc_sysfw.c')
-rw-r--r-- | hw/i386/pc_sysfw.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 2dcaa116ad..b02e285579 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -95,17 +95,15 @@ static void pc_system_flash_cleanup_unused(PCMachineState *pcms) { char *prop_name; int i; - Object *dev_obj; assert(PC_MACHINE_GET_CLASS(pcms)->pci_enabled); for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) { - dev_obj = OBJECT(pcms->flash[i]); - if (!object_property_get_bool(dev_obj, "realized", &error_abort)) { + if (!qdev_is_realized(DEVICE(pcms->flash[i]))) { prop_name = g_strdup_printf("pflash%d", i); object_property_del(OBJECT(pcms), prop_name); g_free(prop_name); - object_unparent(dev_obj); + object_unparent(OBJECT(pcms->flash[i])); pcms->flash[i] = NULL; } } |