mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
qdev: set properties with device_class_set_props()
The following patch will need to handle properties registration during class_init time. Let's use a device_class_set_props() setter. spatch --macro-file scripts/cocci-macro-file.h --sp-file ./scripts/coccinelle/qdev-set-props.cocci --keep-comments --in-place --dir . @@ typedef DeviceClass; DeviceClass *d; expression val; @@ - d->props = val + device_class_set_props(d, val) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b77ade9bb3
commit
4f67d30b5e
399 changed files with 458 additions and 451 deletions
|
@ -359,7 +359,7 @@ static void a9_gtimer_class_init(ObjectClass *klass, void *data)
|
|||
dc->realize = a9_gtimer_realize;
|
||||
dc->vmsd = &vmstate_a9_gtimer;
|
||||
dc->reset = a9_gtimer_reset;
|
||||
dc->props = a9_gtimer_properties;
|
||||
device_class_set_props(dc, a9_gtimer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo a9_gtimer_info = {
|
||||
|
|
|
@ -284,7 +284,7 @@ static void a10_pit_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->reset = a10_pit_reset;
|
||||
dc->props = a10_pit_properties;
|
||||
device_class_set_props(dc, a10_pit_properties);
|
||||
dc->desc = "allwinner a10 timer";
|
||||
dc->vmsd = &vmstate_a10_pit;
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ static void altera_timer_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->realize = altera_timer_realize;
|
||||
dc->props = altera_timer_properties;
|
||||
device_class_set_props(dc, altera_timer_properties);
|
||||
dc->reset = altera_timer_reset;
|
||||
}
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ static void arm_mptimer_class_init(ObjectClass *klass, void *data)
|
|||
dc->realize = arm_mptimer_realize;
|
||||
dc->vmsd = &vmstate_arm_mptimer;
|
||||
dc->reset = arm_mptimer_reset;
|
||||
dc->props = arm_mptimer_properties;
|
||||
device_class_set_props(dc, arm_mptimer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo arm_mptimer_info = {
|
||||
|
|
|
@ -397,7 +397,7 @@ static void sp804_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *k = DEVICE_CLASS(klass);
|
||||
|
||||
k->realize = sp804_realize;
|
||||
k->props = sp804_properties;
|
||||
device_class_set_props(k, sp804_properties);
|
||||
k->vmsd = &vmstate_sp804;
|
||||
}
|
||||
|
||||
|
|
|
@ -685,7 +685,7 @@ static void timer_class_init(ObjectClass *klass, void *data)
|
|||
dc->reset = aspeed_timer_reset;
|
||||
dc->desc = "ASPEED Timer";
|
||||
dc->vmsd = &vmstate_aspeed_timer_state;
|
||||
dc->props = aspeed_timer_properties;
|
||||
device_class_set_props(dc, aspeed_timer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo aspeed_timer_info = {
|
||||
|
|
|
@ -510,7 +510,7 @@ static void cmsdk_apb_dualtimer_class_init(ObjectClass *klass, void *data)
|
|||
dc->realize = cmsdk_apb_dualtimer_realize;
|
||||
dc->vmsd = &cmsdk_apb_dualtimer_vmstate;
|
||||
dc->reset = cmsdk_apb_dualtimer_reset;
|
||||
dc->props = cmsdk_apb_dualtimer_properties;
|
||||
device_class_set_props(dc, cmsdk_apb_dualtimer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo cmsdk_apb_dualtimer_info = {
|
||||
|
|
|
@ -260,7 +260,7 @@ static void cmsdk_apb_timer_class_init(ObjectClass *klass, void *data)
|
|||
dc->realize = cmsdk_apb_timer_realize;
|
||||
dc->vmsd = &cmsdk_apb_timer_vmstate;
|
||||
dc->reset = cmsdk_apb_timer_reset;
|
||||
dc->props = cmsdk_apb_timer_properties;
|
||||
device_class_set_props(dc, cmsdk_apb_timer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo cmsdk_apb_timer_info = {
|
||||
|
|
|
@ -415,7 +415,7 @@ static void grlib_gptimer_class_init(ObjectClass *klass, void *data)
|
|||
|
||||
dc->realize = grlib_gptimer_realize;
|
||||
dc->reset = grlib_gptimer_reset;
|
||||
dc->props = grlib_gptimer_properties;
|
||||
device_class_set_props(dc, grlib_gptimer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo grlib_gptimer_info = {
|
||||
|
|
|
@ -800,7 +800,7 @@ static void hpet_device_class_init(ObjectClass *klass, void *data)
|
|||
dc->realize = hpet_realize;
|
||||
dc->reset = hpet_reset;
|
||||
dc->vmsd = &vmstate_hpet;
|
||||
dc->props = hpet_device_properties;
|
||||
device_class_set_props(dc, hpet_device_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo hpet_device_info = {
|
||||
|
|
|
@ -364,7 +364,7 @@ static void pit_class_initfn(ObjectClass *klass, void *data)
|
|||
k->get_channel_info = pit_get_channel_info_common;
|
||||
k->post_load = pit_post_load;
|
||||
dc->reset = pit_reset;
|
||||
dc->props = pit_properties;
|
||||
device_class_set_props(dc, pit_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo pit_info = {
|
||||
|
|
|
@ -230,7 +230,7 @@ static void lm32_timer_class_init(ObjectClass *klass, void *data)
|
|||
dc->realize = lm32_timer_realize;
|
||||
dc->reset = timer_reset;
|
||||
dc->vmsd = &vmstate_lm32_timer;
|
||||
dc->props = lm32_timer_properties;
|
||||
device_class_set_props(dc, lm32_timer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo lm32_timer_info = {
|
||||
|
|
|
@ -343,7 +343,7 @@ static void milkymist_sysctl_class_init(ObjectClass *klass, void *data)
|
|||
dc->realize = milkymist_sysctl_realize;
|
||||
dc->reset = milkymist_sysctl_reset;
|
||||
dc->vmsd = &vmstate_milkymist_sysctl;
|
||||
dc->props = milkymist_sysctl_properties;
|
||||
device_class_set_props(dc, milkymist_sysctl_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo milkymist_sysctl_info = {
|
||||
|
|
|
@ -278,7 +278,7 @@ static void mss_timer_class_init(ObjectClass *klass, void *data)
|
|||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->props = mss_timer_properties;
|
||||
device_class_set_props(dc, mss_timer_properties);
|
||||
dc->vmsd = &vmstate_mss_timer;
|
||||
}
|
||||
|
||||
|
|
|
@ -562,7 +562,7 @@ static void pxa25x_timer_dev_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->desc = "PXA25x timer";
|
||||
dc->props = pxa25x_timer_dev_properties;
|
||||
device_class_set_props(dc, pxa25x_timer_dev_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo pxa25x_timer_dev_info = {
|
||||
|
@ -584,7 +584,7 @@ static void pxa27x_timer_dev_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->desc = "PXA27x timer";
|
||||
dc->props = pxa27x_timer_dev_properties;
|
||||
device_class_set_props(dc, pxa27x_timer_dev_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo pxa27x_timer_dev_info = {
|
||||
|
|
|
@ -427,7 +427,7 @@ static void slavio_timer_class_init(ObjectClass *klass, void *data)
|
|||
|
||||
dc->reset = slavio_timer_reset;
|
||||
dc->vmsd = &vmstate_slavio_timer;
|
||||
dc->props = slavio_timer_properties;
|
||||
device_class_set_props(dc, slavio_timer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo slavio_timer_info = {
|
||||
|
|
|
@ -323,7 +323,7 @@ static void stm32f2xx_timer_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->reset = stm32f2xx_timer_reset;
|
||||
dc->props = stm32f2xx_timer_properties;
|
||||
device_class_set_props(dc, stm32f2xx_timer_properties);
|
||||
dc->vmsd = &vmstate_stm32f2xx_timer;
|
||||
}
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->realize = xilinx_timer_realize;
|
||||
dc->props = xilinx_timer_properties;
|
||||
device_class_set_props(dc, xilinx_timer_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo xilinx_timer_info = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue