[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/19] hw/core/gpio: Set QDev properties using QDev API
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 06/19] hw/core/gpio: Set QDev properties using QDev API |
Date: |
Fri, 3 Feb 2023 19:09:01 +0100 |
No need to use the low-level QOM API when an object
inherits from QDev. Directly use the QDev API to set
its properties.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/core/gpio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/core/gpio.c b/hw/core/gpio.c
index 80d07a6ec9..ba05dfa92e 100644
--- a/hw/core/gpio.c
+++ b/hw/core/gpio.c
@@ -19,6 +19,7 @@
#include "qemu/osdep.h"
#include "hw/qdev-core.h"
+#include "hw/qdev-properties.h"
#include "hw/irq.h"
#include "qapi/error.h"
@@ -120,13 +121,12 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const
char *name, int n,
char *propname = g_strdup_printf("%s[%d]",
name ? name : "unnamed-gpio-out", n);
if (input_pin && !OBJECT(input_pin)->parent) {
- /* We need a name for object_property_set_link to work */
+ /* We need a name for qdev_prop_set_link to work */
object_property_add_child(container_get(qdev_get_machine(),
"/unattached"),
"non-qdev-gpio[*]", OBJECT(input_pin));
}
- object_property_set_link(OBJECT(dev), propname,
- OBJECT(input_pin), &error_abort);
+ qdev_prop_set_link(dev, propname, OBJECT(input_pin));
g_free(propname);
}
@@ -152,7 +152,7 @@ static qemu_irq qdev_disconnect_gpio_out_named(DeviceState
*dev,
qemu_irq ret = (qemu_irq)object_property_get_link(OBJECT(dev), propname,
NULL);
if (ret) {
- object_property_set_link(OBJECT(dev), propname, NULL, NULL);
+ qdev_prop_set_link(dev, propname, NULL);
}
g_free(propname);
return ret;
--
2.38.1
- [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 01/19] NOTFORMERGE scripts/coccinelle: Add qom-qdev-prop.cocci, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 02/19] hw/qdev: Introduce qdev_prop_set_link(), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 03/19] hw/acpi: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 04/19] hw/audio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 06/19] hw/core/gpio: Set QDev properties using QDev API,
Philippe Mathieu-Daudé <=
- [RFC PATCH 07/19] hw/scsi: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 08/19] hw/usb: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 09/19] hw/virtio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 10/19] hw/avr: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 11/19] hw/hppa: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 12/19] hw/i386: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 13/19] hw/m68k: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 14/19] hw/microblaze: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03