diff options
author | Andreas Färber <afaerber@suse.de> | 2012-02-09 15:20:55 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-15 09:39:21 -0600 |
commit | 83f7d43a9ef70b1b91e465173e18c845420e931e (patch) | |
tree | c34cbc9d6f7986f2d643a9e7077a519386dbb55a /qom | |
parent | 59f971d451fbabee3194bb565f40846398ee6e6f (diff) | |
download | qemu-83f7d43a9ef70b1b91e465173e18c845420e931e.tar.gz qemu-83f7d43a9ef70b1b91e465173e18c845420e931e.tar.bz2 qemu-83f7d43a9ef70b1b91e465173e18c845420e931e.zip |
qom: Unify type registration
Replace device_init() with generalized type_init().
While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: malc <av1474@comtv.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qom')
-rw-r--r-- | qom/container.c | 4 | ||||
-rw-r--r-- | qom/object.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/qom/container.c b/qom/container.c index 946cbff90f..f107208867 100644 --- a/qom/container.c +++ b/qom/container.c @@ -19,9 +19,9 @@ static TypeInfo container_info = { .parent = TYPE_OBJECT, }; -static void container_init(void) +static void container_register_types(void) { type_register_static(&container_info); } -device_init(container_init); +type_init(container_register_types) diff --git a/qom/object.c b/qom/object.c index 5e5b261103..0cbd9bb004 100644 --- a/qom/object.c +++ b/qom/object.c @@ -444,7 +444,7 @@ Object *object_dynamic_cast(Object *obj, const char *typename) } -static void register_interface(void) +static void register_types(void) { static TypeInfo interface_info = { .name = TYPE_INTERFACE, @@ -455,7 +455,7 @@ static void register_interface(void) type_interface = type_register_static(&interface_info); } -device_init(register_interface); +type_init(register_types) Object *object_dynamic_cast_assert(Object *obj, const char *typename) { |