mirror of
https://github.com/mii443/qemu.git
synced 2025-12-07 21:18:22 +00:00
char: use a const CharDriver
No need to allocate & copy fields, let's use static const struct instead. Add an alias field to the CharDriver structure to cover the cases where we previously registered a driver twice under two names. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
bd1caa3f8e
commit
0b812f3192
@@ -671,8 +671,12 @@ fail_handle:
|
||||
|
||||
static void register_types(void)
|
||||
{
|
||||
register_char_driver("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL,
|
||||
chr_baum_init);
|
||||
static const CharDriver driver = {
|
||||
.kind = CHARDEV_BACKEND_KIND_BRAILLE,
|
||||
.create = chr_baum_init,
|
||||
};
|
||||
|
||||
register_char_driver(&driver);
|
||||
}
|
||||
|
||||
type_init(register_types);
|
||||
|
||||
Reference in New Issue
Block a user