diff options
author | Philippe Mathieu-Daudé | 2018-01-14 03:04:12 +0100 |
---|---|---|
committer | Paolo Bonzini | 2018-02-05 13:54:38 +0100 |
commit | bf853881690db8bbd1de39e4be580310a9cb0ebc (patch) | |
tree | a8d261d1094d34f03d216ced7fbdcdc29972b3a8 /hw/intc/arm_gicv3_kvm.c | |
parent | qdev: add helpers to be more explicit when using abstract QOM parent functions (diff) | |
download | qemu-bf853881690db8bbd1de39e4be580310a9cb0ebc.tar.gz qemu-bf853881690db8bbd1de39e4be580310a9cb0ebc.tar.xz qemu-bf853881690db8bbd1de39e4be580310a9cb0ebc.zip |
qdev: use device_class_set_parent_realize/unrealize/reset()
changes generated using the following Coccinelle patch:
@@
type DeviceParentClass;
DeviceParentClass *pc;
DeviceClass *dc;
identifier parent_fn;
identifier child_fn;
@@
(
+device_class_set_parent_realize(dc, child_fn, &pc->parent_fn);
-pc->parent_fn = dc->realize;
...
-dc->realize = child_fn;
|
+device_class_set_parent_unrealize(dc, child_fn, &pc->parent_fn);
-pc->parent_fn = dc->unrealize;
...
-dc->unrealize = child_fn;
|
+device_class_set_parent_reset(dc, child_fn, &pc->parent_fn);
-pc->parent_fn = dc->reset;
...
-dc->reset = child_fn;
)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180114020412.26160-4-f4bug@amsat.org>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/intc/arm_gicv3_kvm.c')
-rw-r--r-- | hw/intc/arm_gicv3_kvm.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 481fe5405a..ec371772b3 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -795,10 +795,9 @@ static void kvm_arm_gicv3_class_init(ObjectClass *klass, void *data) agcc->pre_save = kvm_arm_gicv3_get; agcc->post_load = kvm_arm_gicv3_put; - kgc->parent_realize = dc->realize; - kgc->parent_reset = dc->reset; - dc->realize = kvm_arm_gicv3_realize; - dc->reset = kvm_arm_gicv3_reset; + device_class_set_parent_realize(dc, kvm_arm_gicv3_realize, + &kgc->parent_realize); + device_class_set_parent_reset(dc, kvm_arm_gicv3_reset, &kgc->parent_reset); } static const TypeInfo kvm_arm_gicv3_info = { |