Commit 83f7d43a authored by Andreas Färber's avatar Andreas Färber Committed by Anthony Liguori

qom: Unify type registration

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: default avatarAndreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: malc <av1474@comtv.ru>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 59f971d4
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
{
......
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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++) {
......@@ -2105,4 +2105,4 @@ static void eepro100_register_devices(void)
}
}
device_init(eepro100_register_devices)
type_init(eepro100_register_types)
......@@ -90,9 +90,9 @@ static TypeInfo empty_slot_info = {
.class_init = empty_slot_class_init,
};
static void empty_slot_register_devices(void)
static void empty_slot_register_types(void)
{
type_register_static(&empty_slot_info);
}
device_init(empty_slot_register_devices);
type_init(empty_slot_register_types)
......@@ -1054,9 +1054,10 @@ static TypeInfo es1370_info = {
.class_init = es1370_class_init,
};
static void es1370_register (void)
static void es1370_register_types (void)
{
type_register_static (&es1370_info);
}
device_init (es1370_register);
type_init (es1370_register_types)
......@@ -931,9 +931,9 @@ static TypeInfo escc_info = {
.class_init = escc_class_init,
};
static void escc_register_devices(void)
static void escc_register_types(void)
{
type_register_static(&escc_info);
}
device_init(escc_register_devices)
type_init(escc_register_types)
......@@ -775,9 +775,9 @@ static TypeInfo esp_info = {
.class_init = esp_class_init,
};
static void esp_register_devices(void)
static void esp_register_types(void)
{
type_register_static(&esp_info);
}
device_init(esp_register_devices)
type_init(esp_register_types)
......@@ -637,9 +637,9 @@ static TypeInfo etraxfs_eth_info = {
.class_init = etraxfs_eth_class_init,
};
static void etraxfs_eth_register(void)
static void etraxfs_eth_register_types(void)
{
type_register_static(&etraxfs_eth_info);
}
device_init(etraxfs_eth_register)
type_init(etraxfs_eth_register_types)
......@@ -172,9 +172,9 @@ static TypeInfo etraxfs_pic_info = {
.class_init = etraxfs_pic_class_init,
};
static void etraxfs_pic_register(void)
static void etraxfs_pic_register_types(void)
{
type_register_static(&etraxfs_pic_info);
}
device_init(etraxfs_pic_register)
type_init(etraxfs_pic_register_types)
......@@ -240,9 +240,9 @@ static TypeInfo etraxfs_ser_info = {
.class_init = etraxfs_ser_class_init,
};
static void etraxfs_serial_register(void)
static void etraxfs_serial_register_types(void)
{
type_register_static(&etraxfs_ser_info);
}
device_init(etraxfs_serial_register)
type_init(etraxfs_serial_register_types)
......@@ -343,9 +343,9 @@ static TypeInfo etraxfs_timer_info = {
.class_init = etraxfs_timer_class_init,
};
static void etraxfs_timer_register(void)
static void etraxfs_timer_register_types(void)
{
type_register_static(&etraxfs_timer_info);
}
device_init(etraxfs_timer_register)
type_init(etraxfs_timer_register_types)
......@@ -2043,11 +2043,11 @@ static TypeInfo sun4m_fdc_info = {
.class_init = sun4m_fdc_class_init,
};
static void fdc_register_devices(void)
static void fdc_register_types(void)
{
type_register_static(&isa_fdc_info);
type_register_static(&sysbus_fdc_info);
type_register_static(&sun4m_fdc_info);
}
device_init(fdc_register_devices)
type_init(fdc_register_types)
......@@ -556,9 +556,9 @@ static TypeInfo fw_cfg_info = {
.class_init = fw_cfg_class_init,
};
static void fw_cfg_register_devices(void)
static void fw_cfg_register_types(void)
{
type_register_static(&fw_cfg_info);
}
device_init(fw_cfg_register_devices)
type_init(fw_cfg_register_types)
......@@ -574,9 +574,9 @@ static TypeInfo g364fb_sysbus_info = {
.class_init = g364fb_sysbus_class_init,
};
static void g364fb_register(void)
static void g364fb_register_types(void)
{
type_register_static(&g364fb_sysbus_info);
}
device_init(g364fb_register);
type_init(g364fb_register_types)
......@@ -157,10 +157,10 @@ static TypeInfo grackle_pci_host_info = {
.class_init = pci_grackle_class_init,
};
static void grackle_register_devices(void)
static void grackle_register_types(void)
{
type_register_static(&grackle_pci_info);
type_register_static(&grackle_pci_host_info);
}
device_init(grackle_register_devices)
type_init(grackle_register_types)
......@@ -263,9 +263,9 @@ static TypeInfo grlib_gptimer_info = {
.class_init = grlib_gptimer_class_init,
};
static void grlib_gptimer_register(void)
static void grlib_gptimer_register_types(void)
{
type_register_static(&grlib_gptimer_info);
}
device_init(grlib_gptimer_register)
type_init(grlib_gptimer_register_types)
......@@ -396,9 +396,9 @@ static TypeInfo grlib_gptimer_info = {
.class_init = grlib_gptimer_class_init,
};
static void grlib_gptimer_register(void)
static void grlib_gptimer_register_types(void)
{
type_register_static(&grlib_gptimer_info);
}
device_init(grlib_gptimer_register)
type_init(grlib_gptimer_register_types)
......@@ -377,9 +377,9 @@ static TypeInfo grlib_irqmp_info = {
.class_init = grlib_irqmp_class_init,
};
static void grlib_irqmp_register(void)
static void grlib_irqmp_register_types(void)
{
type_register_static(&grlib_irqmp_info);
}
device_init(grlib_irqmp_register)
type_init(grlib_irqmp_register_types)
......@@ -1168,10 +1168,10 @@ static TypeInfo gt64120_info = {
.class_init = gt64120_class_init,
};
static void gt64120_pci_register_devices(void)
static void gt64120_pci_register_types(void)
{
type_register_static(&gt64120_info);
type_register_static(&gt64120_pci_info);
}
device_init(gt64120_pci_register_devices)
type_init(gt64120_pci_register_types)
......@@ -324,8 +324,9 @@ static TypeInfo gus_info = {
.class_init = gus_class_initfn,
};
static void gus_register (void)
static void gus_register_types (void)
{
type_register_static (&gus_info);
}
device_init (gus_register)
type_init (gus_register_types)
......@@ -948,9 +948,10 @@ static TypeInfo hda_audio_duplex_info = {
.class_init = hda_audio_duplex_class_init,
};
static void hda_audio_register(void)
static void hda_audio_register_types(void)
{
type_register_static(&hda_audio_output_info);
type_register_static(&hda_audio_duplex_info);
}
device_init(hda_audio_register);
type_init(hda_audio_register_types)
......@@ -177,12 +177,12 @@ static TypeInfo highbank_regs_info = {
.class_init = highbank_regs_class_init,
};
static void highbank_regs_register_device(void)
static void highbank_regs_register_types(void)
{