mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
qdev: set properties with device_class_set_props()
The following patch will need to handle properties registration during class_init time. Let's use a device_class_set_props() setter. spatch --macro-file scripts/cocci-macro-file.h --sp-file ./scripts/coccinelle/qdev-set-props.cocci --keep-comments --in-place --dir . @@ typedef DeviceClass; DeviceClass *d; expression val; @@ - d->props = val + device_class_set_props(d, val) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
b77ade9bb3
commit
4f67d30b5e
@@ -1456,7 +1456,7 @@ static void ccid_class_initfn(ObjectClass *klass, void *data)
|
||||
uc->unrealize = ccid_unrealize;
|
||||
dc->desc = "CCID Rev 1.1 smartcard reader";
|
||||
dc->vmsd = &ccid_vmstate;
|
||||
dc->props = ccid_properties;
|
||||
device_class_set_props(dc, ccid_properties);
|
||||
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
|
||||
hc->unplug = qdev_simple_device_unplug_cb;
|
||||
}
|
||||
@@ -1478,7 +1478,7 @@ static void ccid_card_class_init(ObjectClass *klass, void *data)
|
||||
k->bus_type = TYPE_CCID_BUS;
|
||||
k->realize = ccid_card_realize;
|
||||
k->unrealize = ccid_card_unrealize;
|
||||
k->props = ccid_props;
|
||||
device_class_set_props(k, ccid_props);
|
||||
}
|
||||
|
||||
static const TypeInfo ccid_card_type_info = {
|
||||
|
||||
Reference in New Issue
Block a user