Skip to content

Commit

Permalink
qom: Unify type registration
Browse files Browse the repository at this point in the history
Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: malc <av1474@comtv.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
afaerber authored and Anthony Liguori committed Feb 15, 2012
1 parent 59f971d commit 83f7d43
Show file tree
Hide file tree
Showing 233 changed files with 551 additions and 554 deletions.
4 changes: 2 additions & 2 deletions hw/9pfs/virtio-9p-device.c
Expand Up @@ -184,10 +184,10 @@ static TypeInfo virtio_9p_info = {
.class_init = virtio_9p_class_init,
};

static void virtio_9p_register_devices(void)
static void virtio_9p_register_types(void)
{
type_register_static(&virtio_9p_info);
virtio_9p_set_fd_limit();
}

device_init(virtio_9p_register_devices)
type_init(virtio_9p_register_types)
4 changes: 2 additions & 2 deletions hw/a9mpcore.c
Expand Up @@ -238,9 +238,9 @@ static TypeInfo a9mp_priv_info = {
.class_init = a9mp_priv_class_init,
};

static void a9mp_register_devices(void)
static void a9mp_register_types(void)
{
type_register_static(&a9mp_priv_info);
}

device_init(a9mp_register_devices)
type_init(a9mp_register_types)
4 changes: 2 additions & 2 deletions hw/ac97.c
Expand Up @@ -1372,9 +1372,9 @@ static TypeInfo ac97_info = {
.class_init = ac97_class_init,
};

static void ac97_register (void)
static void ac97_register_types (void)
{
type_register_static (&ac97_info);
}
device_init (ac97_register);

type_init (ac97_register_types)
4 changes: 2 additions & 2 deletions hw/acpi_piix4.c
Expand Up @@ -426,12 +426,12 @@ static TypeInfo piix4_pm_info = {
.class_init = piix4_pm_class_init,
};

static void piix4_pm_register(void)
static void piix4_pm_register_types(void)
{
type_register_static(&piix4_pm_info);
}

device_init(piix4_pm_register);
type_init(piix4_pm_register_types)

static uint32_t gpe_readb(void *opaque, uint32_t addr)
{
Expand Down
4 changes: 2 additions & 2 deletions hw/ads7846.c
Expand Up @@ -168,9 +168,9 @@ static TypeInfo ads7846_info = {
.class_init = ads7846_class_init,
};

static void ads7846_register_devices(void)
static void ads7846_register_types(void)
{
type_register_static(&ads7846_info);
}

device_init(ads7846_register_devices)
type_init(ads7846_register_types)
5 changes: 3 additions & 2 deletions hw/alpha_typhoon.c
Expand Up @@ -824,8 +824,9 @@ static TypeInfo typhoon_pcihost_info = {
.class_init = typhoon_pcihost_class_init,
};

static void typhoon_register(void)
static void typhoon_register_types(void)
{
type_register_static(&typhoon_pcihost_info);
}
device_init(typhoon_register);

type_init(typhoon_register_types)
4 changes: 2 additions & 2 deletions hw/apb_pci.c
Expand Up @@ -493,11 +493,11 @@ static TypeInfo pbm_pci_bridge_info = {
.class_init = pbm_pci_bridge_class_init,
};

static void pbm_register_devices(void)
static void pbm_register_types(void)
{
type_register_static(&pbm_host_info);
type_register_static(&pbm_pci_host_info);
type_register_static(&pbm_pci_bridge_info);
}

device_init(pbm_register_devices)
type_init(pbm_register_types)
4 changes: 2 additions & 2 deletions hw/apic.c
Expand Up @@ -781,9 +781,9 @@ static TypeInfo apic_info = {
.class_init = apic_class_init,
};

static void apic_register_devices(void)
static void apic_register_types(void)
{
type_register_static(&apic_info);
}

device_init(apic_register_devices)
type_init(apic_register_types)
4 changes: 2 additions & 2 deletions hw/apic_common.c
Expand Up @@ -313,9 +313,9 @@ static TypeInfo apic_common_type = {
.abstract = true,
};

static void register_devices(void)
static void register_types(void)
{
type_register_static(&apic_common_type);
}

device_init(register_devices);
type_init(register_types)
4 changes: 2 additions & 2 deletions hw/applesmc.c
Expand Up @@ -243,9 +243,9 @@ static TypeInfo applesmc_isa_info = {
.class_init = qdev_applesmc_class_init,
};

static void applesmc_register_devices(void)
static void applesmc_register_types(void)
{
type_register_static(&applesmc_isa_info);
}

device_init(applesmc_register_devices)
type_init(applesmc_register_types)
4 changes: 2 additions & 2 deletions hw/arm11mpcore.c
Expand Up @@ -252,10 +252,10 @@ static TypeInfo mpcore_priv_info = {
.class_init = mpcore_priv_class_init,
};

static void arm11mpcore_register_devices(void)
static void arm11mpcore_register_types(void)
{
type_register_static(&mpcore_rirq_info);
type_register_static(&mpcore_priv_info);
}

device_init(arm11mpcore_register_devices)
type_init(arm11mpcore_register_types)
4 changes: 2 additions & 2 deletions hw/arm_l2x0.c
Expand Up @@ -184,9 +184,9 @@ static TypeInfo l2x0_info = {
.class_init = l2x0_class_init,
};

static void l2x0_register_device(void)
static void l2x0_register_types(void)
{
type_register_static(&l2x0_info);
}

device_init(l2x0_register_device)
type_init(l2x0_register_types)
4 changes: 2 additions & 2 deletions hw/arm_mptimer.c
Expand Up @@ -335,9 +335,9 @@ static TypeInfo arm_mptimer_info = {
.class_init = arm_mptimer_class_init,
};

static void arm_mptimer_register_devices(void)
static void arm_mptimer_register_types(void)
{
type_register_static(&arm_mptimer_info);
}

device_init(arm_mptimer_register_devices)
type_init(arm_mptimer_register_types)
4 changes: 2 additions & 2 deletions hw/arm_sysctl.c
Expand Up @@ -425,9 +425,9 @@ static TypeInfo arm_sysctl_info = {
.class_init = arm_sysctl_class_init,
};

static void arm_sysctl_register_devices(void)
static void arm_sysctl_register_types(void)
{
type_register_static(&arm_sysctl_info);
}

device_init(arm_sysctl_register_devices)
type_init(arm_sysctl_register_types)
4 changes: 2 additions & 2 deletions hw/arm_timer.c
Expand Up @@ -383,10 +383,10 @@ static TypeInfo sp804_info = {
.class_init = sp804_class_init,
};

static void arm_timer_register_devices(void)
static void arm_timer_register_types(void)
{
type_register_static(&icp_pit_info);
type_register_static(&sp804_info);
}

device_init(arm_timer_register_devices)
type_init(arm_timer_register_types)
4 changes: 2 additions & 2 deletions hw/armv7m.c
Expand Up @@ -266,9 +266,9 @@ static TypeInfo bitband_info = {
.class_init = bitband_class_init,
};

static void armv7m_register_devices(void)
static void armv7m_register_types(void)
{
type_register_static(&bitband_info);
}

device_init(armv7m_register_devices)
type_init(armv7m_register_types)
4 changes: 2 additions & 2 deletions hw/armv7m_nvic.c
Expand Up @@ -417,9 +417,9 @@ static TypeInfo armv7m_nvic_info = {
.class_init = armv7m_nvic_class_init,
};

static void armv7m_nvic_register_devices(void)
static void armv7m_nvic_register_types(void)
{
type_register_static(&armv7m_nvic_info);
}

device_init(armv7m_nvic_register_devices)
type_init(armv7m_nvic_register_types)
4 changes: 2 additions & 2 deletions hw/bitbang_i2c.c
Expand Up @@ -237,9 +237,9 @@ static TypeInfo gpio_i2c_info = {
.class_init = gpio_i2c_class_init,
};

static void bitbang_i2c_register(void)
static void bitbang_i2c_register_types(void)
{
type_register_static(&gpio_i2c_info);
}

device_init(bitbang_i2c_register)
type_init(bitbang_i2c_register_types)
5 changes: 3 additions & 2 deletions hw/bonito.c
Expand Up @@ -804,9 +804,10 @@ static TypeInfo bonito_pcihost_info = {
.class_init = bonito_pcihost_class_init,
};

static void bonito_register(void)
static void bonito_register_types(void)
{
type_register_static(&bonito_pcihost_info);
type_register_static(&bonito_info);
}
device_init(bonito_register);

type_init(bonito_register_types)
4 changes: 2 additions & 2 deletions hw/ccid-card-emulated.c
Expand Up @@ -594,9 +594,9 @@ static TypeInfo emulated_card_info = {
.class_init = emulated_class_initfn,
};

static void ccid_card_emulated_register_devices(void)
static void ccid_card_emulated_register_types(void)
{
type_register_static(&emulated_card_info);
}

device_init(ccid_card_emulated_register_devices)
type_init(ccid_card_emulated_register_types)
4 changes: 2 additions & 2 deletions hw/ccid-card-passthru.c
Expand Up @@ -343,9 +343,9 @@ static TypeInfo passthru_card_info = {
.class_init = passthru_class_initfn,
};

static void ccid_card_passthru_register_devices(void)
static void ccid_card_passthru_register_types(void)
{
type_register_static(&passthru_card_info);
}

device_init(ccid_card_passthru_register_devices)
type_init(ccid_card_passthru_register_types)
12 changes: 4 additions & 8 deletions hw/cirrus_vga.c
Expand Up @@ -2923,12 +2923,6 @@ static TypeInfo isa_cirrus_vga_info = {
.class_init = isa_cirrus_vga_class_init,
};

static void isa_cirrus_vga_register(void)
{
type_register_static(&isa_cirrus_vga_info);
}
device_init(isa_cirrus_vga_register)

/***************************************
*
* PCI bus support
Expand Down Expand Up @@ -2996,8 +2990,10 @@ static TypeInfo cirrus_vga_info = {
.class_init = cirrus_vga_class_init,
};

static void cirrus_vga_register(void)
static void cirrus_vga_register_types(void)
{
type_register_static(&isa_cirrus_vga_info);
type_register_static(&cirrus_vga_info);
}
device_init(cirrus_vga_register);

type_init(cirrus_vga_register_types)
4 changes: 2 additions & 2 deletions hw/cs4231.c
Expand Up @@ -173,9 +173,9 @@ static TypeInfo cs4231_info = {
.class_init = cs4231_class_init,
};

static void cs4231_register_devices(void)
static void cs4231_register_types(void)
{
type_register_static(&cs4231_info);
}

device_init(cs4231_register_devices)
type_init(cs4231_register_types)
5 changes: 3 additions & 2 deletions hw/cs4231a.c
Expand Up @@ -689,8 +689,9 @@ static TypeInfo cs4231a_info = {
.class_init = cs4231a_class_initfn,
};

static void cs4231a_register (void)
static void cs4231a_register_types (void)
{
type_register_static (&cs4231a_info);
}
device_init (cs4231a_register)

type_init (cs4231a_register_types)
4 changes: 2 additions & 2 deletions hw/debugcon.c
Expand Up @@ -109,9 +109,9 @@ static TypeInfo debugcon_isa_info = {
.class_init = debugcon_isa_class_initfn,
};

static void debugcon_register_devices(void)
static void debugcon_register_types(void)
{
type_register_static(&debugcon_isa_info);
}

device_init(debugcon_register_devices)
type_init(debugcon_register_types)
4 changes: 2 additions & 2 deletions hw/dec_pci.c
Expand Up @@ -140,11 +140,11 @@ static TypeInfo pci_dec_21154_device_info = {
.class_init = pci_dec_21154_device_class_init,
};

static void dec_register_devices(void)
static void dec_register_types(void)
{
type_register_static(&pci_dec_21154_device_info);
type_register_static(&dec_21154_pci_host_info);
type_register_static(&dec_21154_pci_bridge_info);
}

device_init(dec_register_devices)
type_init(dec_register_types)
4 changes: 2 additions & 2 deletions hw/ds1225y.c
Expand Up @@ -157,9 +157,9 @@ static TypeInfo nvram_sysbus_info = {
.class_init = nvram_sysbus_class_init,
};

static void nvram_register(void)
static void nvram_register_types(void)
{
type_register_static(&nvram_sysbus_info);
}

device_init(nvram_register)
type_init(nvram_register_types)
4 changes: 2 additions & 2 deletions hw/ds1338.c
Expand Up @@ -135,9 +135,9 @@ static TypeInfo ds1338_info = {
.class_init = ds1338_class_init,
};

static void ds1338_register_devices(void)
static void ds1338_register_types(void)
{
type_register_static(&ds1338_info);
}

device_init(ds1338_register_devices)
type_init(ds1338_register_types)
4 changes: 2 additions & 2 deletions hw/e1000.c
Expand Up @@ -1227,9 +1227,9 @@ static TypeInfo e1000_info = {
.class_init = e1000_class_init,
};

static void e1000_register_devices(void)
static void e1000_register_types(void)
{
type_register_static(&e1000_info);
}

device_init(e1000_register_devices)
type_init(e1000_register_types)
4 changes: 2 additions & 2 deletions hw/eccmemctl.c
Expand Up @@ -332,9 +332,9 @@ static TypeInfo ecc_info = {
};


static void ecc_register_devices(void)
static void ecc_register_types(void)
{
type_register_static(&ecc_info);
}

device_init(ecc_register_devices)
type_init(ecc_register_types)
4 changes: 2 additions & 2 deletions hw/eepro100.c
Expand Up @@ -2089,7 +2089,7 @@ static void eepro100_class_init(ObjectClass *klass, void *data)
k->subsystem_id = info->subsystem_id;
}

static void eepro100_register_devices(void)
static void eepro100_register_types(void)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(e100_devices); i++) {
Expand All @@ -2105,4 +2105,4 @@ static void eepro100_register_devices(void)
}
}

device_init(eepro100_register_devices)
type_init(eepro100_register_types)

0 comments on commit 83f7d43

Please sign in to comment.