audio: don't use 'Yoda conditions'
[qemu/ar7.git] / qom / object_interfaces.c
blob6360818397143410488b4089ed1af18a342eaeb9
1 #include "qom/object_interfaces.h"
2 #include "qemu/module.h"
4 void user_creatable_complete(Object *obj, Error **errp)
7 UserCreatableClass *ucc;
8 UserCreatable *uc =
9 (UserCreatable *)object_dynamic_cast(obj, TYPE_USER_CREATABLE);
11 if (!uc) {
12 return;
15 ucc = USER_CREATABLE_GET_CLASS(uc);
16 if (ucc->complete) {
17 ucc->complete(uc, errp);
21 static void register_types(void)
23 static const TypeInfo uc_interface_info = {
24 .name = TYPE_USER_CREATABLE,
25 .parent = TYPE_INTERFACE,
26 .class_size = sizeof(UserCreatableClass),
29 type_register_static(&uc_interface_info);
32 type_init(register_types)