hw/block/pflash_cfi01: Prefer DEFINE_TYPES() macro
Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Bernhard Beschow <shentey@gmail.com> Message-ID: <20241103133412.73536-22-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
911f4dd85b
commit
2b88cd1782
@ -47,7 +47,6 @@
|
|||||||
#include "qemu/bitops.h"
|
#include "qemu/bitops.h"
|
||||||
#include "qemu/host-utils.h"
|
#include "qemu/host-utils.h"
|
||||||
#include "qemu/log.h"
|
#include "qemu/log.h"
|
||||||
#include "qemu/module.h"
|
|
||||||
#include "qemu/option.h"
|
#include "qemu/option.h"
|
||||||
#include "hw/sysbus.h"
|
#include "hw/sysbus.h"
|
||||||
#include "migration/vmstate.h"
|
#include "migration/vmstate.h"
|
||||||
@ -947,20 +946,16 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data)
|
|||||||
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const TypeInfo pflash_cfi01_types[] = {
|
||||||
static const TypeInfo pflash_cfi01_info = {
|
{
|
||||||
.name = TYPE_PFLASH_CFI01,
|
.name = TYPE_PFLASH_CFI01,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(PFlashCFI01),
|
.instance_size = sizeof(PFlashCFI01),
|
||||||
.class_init = pflash_cfi01_class_init,
|
.class_init = pflash_cfi01_class_init,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pflash_cfi01_register_types(void)
|
DEFINE_TYPES(pflash_cfi01_types)
|
||||||
{
|
|
||||||
type_register_static(&pflash_cfi01_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(pflash_cfi01_register_types)
|
|
||||||
|
|
||||||
PFlashCFI01 *pflash_cfi01_register(hwaddr base,
|
PFlashCFI01 *pflash_cfi01_register(hwaddr base,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user