[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 21/26] hw/block/pflash_cfi01: Prefer DEFINE_TYPES() macro
From: |
Bernhard Beschow |
Subject: |
[PATCH v3 21/26] hw/block/pflash_cfi01: Prefer DEFINE_TYPES() macro |
Date: |
Sat, 2 Nov 2024 14:17:10 +0100 |
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/block/pflash_cfi01.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 7b6ec64442..cf11dada29 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -47,7 +47,6 @@
#include "qemu/bitops.h"
#include "qemu/host-utils.h"
#include "qemu/log.h"
-#include "qemu/module.h"
#include "qemu/option.h"
#include "hw/sysbus.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);
}
-
-static const TypeInfo pflash_cfi01_info = {
- .name = TYPE_PFLASH_CFI01,
- .parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(PFlashCFI01),
- .class_init = pflash_cfi01_class_init,
+static const TypeInfo types[] = {
+ {
+ .name = TYPE_PFLASH_CFI01,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(PFlashCFI01),
+ .class_init = pflash_cfi01_class_init,
+ },
};
-static void pflash_cfi01_register_types(void)
-{
- type_register_static(&pflash_cfi01_info);
-}
-
-type_init(pflash_cfi01_register_types)
+DEFINE_TYPES(types)
PFlashCFI01 *pflash_cfi01_register(hwaddr base,
const char *name,
--
2.47.0
- [PATCH v3 06/26] hw/ppc/e500: Reuse TYPE_GPIO_PWR, (continued)
- [PATCH v3 06/26] hw/ppc/e500: Reuse TYPE_GPIO_PWR, Bernhard Beschow, 2024/11/02
- [PATCH v3 10/26] hw/ppc/mpc8544_guts: Populate POR PLL ratio status register, Bernhard Beschow, 2024/11/02
- [PATCH v3 14/26] hw/pci-host/ppce500: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
- [PATCH v3 15/26] hw/net/fsl_etsec/miim: Reuse MII constants, Bernhard Beschow, 2024/11/02
- [PATCH v3 19/26] hw/intc: Guard openpic_kvm.c by dedicated OPENPIC_KVM Kconfig switch, Bernhard Beschow, 2024/11/02
- [PATCH v3 22/26] hw/i2c/smbus_eeprom: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
[PATCH v3 21/26] hw/block/pflash_cfi01: Prefer DEFINE_TYPES() macro,
Bernhard Beschow <=
[PATCH v3 01/26] hw/ppc/e500: Do not leak struct boot_info, Bernhard Beschow, 2024/11/02
[PATCH v3 23/26] hw/rtc/ds1338: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
[PATCH v3 02/26] hw/ppc/e500: Remove firstenv variable, Bernhard Beschow, 2024/11/02
[PATCH v3 09/26] hw/ppc/ppce500_ccsr: Trace access to CCSR region, Bernhard Beschow, 2024/11/02
[PATCH v3 08/26] hw/ppc/e500: Extract ppce500_ccsr.c, Bernhard Beschow, 2024/11/02
[PATCH v3 26/26] MAINTAINERS: Add hw/gpio/gpio_pwr.c, Bernhard Beschow, 2024/11/02
[PATCH v3 04/26] hw/ppc/e500: Remove unused "irqs" parameter, Bernhard Beschow, 2024/11/02
[PATCH v3 05/26] hw/ppc/e500: Add missing device tree properties to i2c controller node, Bernhard Beschow, 2024/11/02
[PATCH v3 03/26] hw/ppc/e500: Prefer QOM cast, Bernhard Beschow, 2024/11/02
[PATCH v3 11/26] hw/i2c/mpc_i2c: Convert DPRINTF to trace events for register access, Bernhard Beschow, 2024/11/02