[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro
From: |
Corey Minyard |
Subject: |
Re: [PATCH v3 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro |
Date: |
Sat, 2 Nov 2024 12:26:41 -0500 |
On Sat, Nov 02, 2024 at 02:17:01PM +0100, Bernhard Beschow wrote:
> 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..16f4309ea9 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 types[] = {
Same question as smbus_eeprom. The old name was more descriptive.
-corey
> + {
> + .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(types)
> --
> 2.47.0
>
>
- [PATCH v3 11/26] hw/i2c/mpc_i2c: Convert DPRINTF to trace events for register access, (continued)
- [PATCH v3 16/26] hw/net/fsl_etsec/etsec: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
- [PATCH v3 17/26] hw/gpio/mpc8xxx: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
- [PATCH v3 07/26] hw/ppc/e500: Use SysBusDevice API to access TYPE_CCSR's internal resources, Bernhard Beschow, 2024/11/02
- [PATCH v3 20/26] hw/sd/sdhci: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
- [PATCH v3 13/26] hw/pci-host/ppce500: Reuse TYPE_PPC_E500_PCI_BRIDGE define, Bernhard Beschow, 2024/11/02
- [PATCH v3 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
- Re: [PATCH v3 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro,
Corey Minyard <=
- [PATCH v3 18/26] hw/ppc/mpc8544_guts: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
- [PATCH v3 24/26] hw/usb/hcd-ehci-sysbus: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/02
- [PATCH v3 25/26] hw/vfio/platform: Let vfio_start_eventfd_injection() take VFIOPlatformDevice pointer, Bernhard Beschow, 2024/11/02