@@ -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;
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(-)