[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro
From: |
Bernhard Beschow |
Subject: |
[PATCH v4 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro |
Date: |
Sun, 3 Nov 2024 14:33:58 +0100 |
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/i2c/mpc_i2c.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c
index 3d79c15653..913d044ac1 100644
--- a/hw/i2c/mpc_i2c.c
+++ b/hw/i2c/mpc_i2c.c
@@ -20,7 +20,6 @@
#include "qemu/osdep.h"
#include "hw/i2c/i2c.h"
#include "hw/irq.h"
-#include "qemu/module.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
#include "qom/object.h"
@@ -345,16 +344,13 @@ static void mpc_i2c_class_init(ObjectClass *klass, void
*data)
dc->desc = "MPC I2C Controller";
}
-static const TypeInfo mpc_i2c_type_info = {
- .name = TYPE_MPC_I2C,
- .parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(MPCI2CState),
- .class_init = mpc_i2c_class_init,
+static const TypeInfo mpc_i2c_types[] = {
+ {
+ .name = TYPE_MPC_I2C,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(MPCI2CState),
+ .class_init = mpc_i2c_class_init,
+ },
};
-static void mpc_i2c_register_types(void)
-{
- type_register_static(&mpc_i2c_type_info);
-}
-
-type_init(mpc_i2c_register_types)
+DEFINE_TYPES(mpc_i2c_types)
--
2.47.0
- [PATCH v4 00/26] E500 Cleanup, Bernhard Beschow, 2024/11/03
- [PATCH v4 01/26] hw/ppc/e500: Do not leak struct boot_info, Bernhard Beschow, 2024/11/03
- [PATCH v4 05/26] hw/ppc/e500: Add missing device tree properties to i2c controller node, Bernhard Beschow, 2024/11/03
- [PATCH v4 06/26] hw/ppc/e500: Reuse TYPE_GPIO_PWR, Bernhard Beschow, 2024/11/03
- [PATCH v4 03/26] hw/ppc/e500: Prefer QOM cast, Bernhard Beschow, 2024/11/03
- [PATCH v4 02/26] hw/ppc/e500: Remove firstenv variable, Bernhard Beschow, 2024/11/03
- [PATCH v4 04/26] hw/ppc/e500: Remove unused "irqs" parameter, Bernhard Beschow, 2024/11/03
- [PATCH v4 09/26] hw/ppc/ppce500_ccsr: Trace access to CCSR region, Bernhard Beschow, 2024/11/03
- [PATCH v4 10/26] hw/ppc/mpc8544_guts: Populate POR PLL ratio status register, Bernhard Beschow, 2024/11/03
- [PATCH v4 11/26] hw/i2c/mpc_i2c: Convert DPRINTF to trace events for register access, Bernhard Beschow, 2024/11/03
- [PATCH v4 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro,
Bernhard Beschow <=
- [PATCH v4 07/26] hw/ppc/e500: Use SysBusDevice API to access TYPE_CCSR's internal resources, Bernhard Beschow, 2024/11/03
- [PATCH v4 08/26] hw/ppc/e500: Extract ppce500_ccsr.c, Bernhard Beschow, 2024/11/03
- [PATCH v4 15/26] hw/net/fsl_etsec/miim: Reuse MII constants, Bernhard Beschow, 2024/11/03
- [PATCH v4 14/26] hw/pci-host/ppce500: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/03
- [PATCH v4 13/26] hw/pci-host/ppce500: Reuse TYPE_PPC_E500_PCI_BRIDGE define, Bernhard Beschow, 2024/11/03
- [PATCH v4 16/26] hw/net/fsl_etsec/etsec: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/03
- [PATCH v4 17/26] hw/gpio/mpc8xxx: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/03
- [PATCH v4 18/26] hw/ppc/mpc8544_guts: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/03