aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-10 19:30:32 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-24 20:59:15 +0100
commit4f67d30b5e74e060b8dbe10528829b47345cd6e8 (patch)
tree025b44a1cb86fe029ed4c105b2764a13c21c5bba /hw/char
parentb77ade9bb37b2e9813a42008cb21d0c743aa50a1 (diff)
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>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/bcm2835_aux.c2
-rw-r--r--hw/char/cadence_uart.c2
-rw-r--r--hw/char/cmsdk-apb-uart.c2
-rw-r--r--hw/char/debugcon.c2
-rw-r--r--hw/char/digic-uart.c2
-rw-r--r--hw/char/escc.c2
-rw-r--r--hw/char/etraxfs_ser.c2
-rw-r--r--hw/char/exynos4210_uart.c2
-rw-r--r--hw/char/grlib_apbuart.c2
-rw-r--r--hw/char/imx_serial.c2
-rw-r--r--hw/char/ipoctal232.c2
-rw-r--r--hw/char/lm32_juart.c2
-rw-r--r--hw/char/lm32_uart.c2
-rw-r--r--hw/char/mcf_uart.c2
-rw-r--r--hw/char/milkymist-uart.c2
-rw-r--r--hw/char/nrf51_uart.c2
-rw-r--r--hw/char/parallel.c2
-rw-r--r--hw/char/pl011.c2
-rw-r--r--hw/char/sclpconsole-lm.c2
-rw-r--r--hw/char/sclpconsole.c2
-rw-r--r--hw/char/serial-isa.c2
-rw-r--r--hw/char/serial-pci-multi.c4
-rw-r--r--hw/char/serial-pci.c2
-rw-r--r--hw/char/serial.c4
-rw-r--r--hw/char/spapr_vty.c2
-rw-r--r--hw/char/stm32f2xx_usart.c2
-rw-r--r--hw/char/terminal3270.c2
-rw-r--r--hw/char/virtio-console.c2
-rw-r--r--hw/char/virtio-serial-bus.c4
-rw-r--r--hw/char/xilinx_uartlite.c2
30 files changed, 33 insertions, 33 deletions
diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c
index a6fc1bf152..ee3dd40e3c 100644
--- a/hw/char/bcm2835_aux.c
+++ b/hw/char/bcm2835_aux.c
@@ -299,7 +299,7 @@ static void bcm2835_aux_class_init(ObjectClass *oc, void *data)
dc->realize = bcm2835_aux_realize;
dc->vmsd = &vmstate_bcm2835_aux;
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
- dc->props = bcm2835_aux_props;
+ device_class_set_props(dc, bcm2835_aux_props);
}
static const TypeInfo bcm2835_aux_info = {
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 51791bd217..22e47972f1 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -550,7 +550,7 @@ static void cadence_uart_class_init(ObjectClass *klass, void *data)
dc->realize = cadence_uart_realize;
dc->vmsd = &vmstate_cadence_uart;
dc->reset = cadence_uart_reset;
- dc->props = cadence_uart_properties;
+ device_class_set_props(dc, cadence_uart_properties);
}
static const TypeInfo cadence_uart_info = {
diff --git a/hw/char/cmsdk-apb-uart.c b/hw/char/cmsdk-apb-uart.c
index 9e1aa43bd3..626b68f2ec 100644
--- a/hw/char/cmsdk-apb-uart.c
+++ b/hw/char/cmsdk-apb-uart.c
@@ -389,7 +389,7 @@ static void cmsdk_apb_uart_class_init(ObjectClass *klass, void *data)
dc->realize = cmsdk_apb_uart_realize;
dc->vmsd = &cmsdk_apb_uart_vmstate;
dc->reset = cmsdk_apb_uart_reset;
- dc->props = cmsdk_apb_uart_properties;
+ device_class_set_props(dc, cmsdk_apb_uart_properties);
}
static const TypeInfo cmsdk_apb_uart_info = {
diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index 5c592e091b..c8d938efb5 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -125,7 +125,7 @@ static void debugcon_isa_class_initfn(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = debugcon_isa_realizefn;
- dc->props = debugcon_isa_properties;
+ device_class_set_props(dc, debugcon_isa_properties);
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}
diff --git a/hw/char/digic-uart.c b/hw/char/digic-uart.c
index 033eba0a6a..e130cb4692 100644
--- a/hw/char/digic-uart.c
+++ b/hw/char/digic-uart.c
@@ -183,7 +183,7 @@ static void digic_uart_class_init(ObjectClass *klass, void *data)
dc->realize = digic_uart_realize;
dc->reset = digic_uart_reset;
dc->vmsd = &vmstate_digic_uart;
- dc->props = digic_uart_properties;
+ device_class_set_props(dc, digic_uart_properties);
}
static const TypeInfo digic_uart_info = {
diff --git a/hw/char/escc.c b/hw/char/escc.c
index c40c1d28f1..7d16ee8688 100644
--- a/hw/char/escc.c
+++ b/hw/char/escc.c
@@ -865,7 +865,7 @@ static void escc_class_init(ObjectClass *klass, void *data)
dc->reset = escc_reset;
dc->realize = escc_realize;
dc->vmsd = &vmstate_escc;
- dc->props = escc_properties;
+ device_class_set_props(dc, escc_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c
index f34f767c60..947bdb649a 100644
--- a/hw/char/etraxfs_ser.c
+++ b/hw/char/etraxfs_ser.c
@@ -244,7 +244,7 @@ static void etraxfs_ser_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->reset = etraxfs_ser_reset;
- dc->props = etraxfs_ser_properties;
+ device_class_set_props(dc, etraxfs_ser_properties);
dc->realize = etraxfs_ser_realize;
}
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 7e5c5ce789..238aa0a5c7 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -645,7 +645,7 @@ static void exynos4210_uart_class_init(ObjectClass *klass, void *data)
dc->realize = exynos4210_uart_realize;
dc->reset = exynos4210_uart_reset;
- dc->props = exynos4210_uart_properties;
+ device_class_set_props(dc, exynos4210_uart_properties);
dc->vmsd = &vmstate_exynos4210_uart;
}
diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c
index 8e59c3bc6e..16d0feac59 100644
--- a/hw/char/grlib_apbuart.c
+++ b/hw/char/grlib_apbuart.c
@@ -285,7 +285,7 @@ static void grlib_apbuart_class_init(ObjectClass *klass, void *data)
dc->realize = grlib_apbuart_realize;
dc->reset = grlib_apbuart_reset;
- dc->props = grlib_apbuart_properties;
+ device_class_set_props(dc, grlib_apbuart_properties);
}
static const TypeInfo grlib_apbuart_info = {
diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index d09c210709..731b8fc64c 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -372,7 +372,7 @@ static void imx_serial_class_init(ObjectClass *klass, void *data)
dc->reset = imx_serial_reset_at_boot;
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
dc->desc = "i.MX series UART";
- dc->props = imx_serial_properties;
+ device_class_set_props(dc, imx_serial_properties);
}
static const TypeInfo imx_serial_info = {
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 80e9dff701..d7c497b939 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -588,7 +588,7 @@ static void ipoctal_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
dc->desc = "GE IP-Octal 232 8-channel RS-232 IndustryPack";
- dc->props = ipoctal_properties;
+ device_class_set_props(dc, ipoctal_properties);
dc->vmsd = &vmstate_ipoctal;
}
diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c
index da9dd5668b..3f34861233 100644
--- a/hw/char/lm32_juart.c
+++ b/hw/char/lm32_juart.c
@@ -146,7 +146,7 @@ static void lm32_juart_class_init(ObjectClass *klass, void *data)
dc->reset = juart_reset;
dc->vmsd = &vmstate_lm32_juart;
- dc->props = lm32_juart_properties;
+ device_class_set_props(dc, lm32_juart_properties);
dc->realize = lm32_juart_realize;
}
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index 8d7a475c91..b0b1092889 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -293,7 +293,7 @@ static void lm32_uart_class_init(ObjectClass *klass, void *data)
dc->reset = uart_reset;
dc->vmsd = &vmstate_lm32_uart;
- dc->props = lm32_uart_properties;
+ device_class_set_props(dc, lm32_uart_properties);
dc->realize = lm32_uart_realize;
}
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index 2de3680b5d..97e4bbc31a 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -320,7 +320,7 @@ static void mcf_uart_class_init(ObjectClass *oc, void *data)
dc->realize = mcf_uart_realize;
dc->reset = mcf_uart_reset;
- dc->props = mcf_uart_properties;
+ device_class_set_props(dc, mcf_uart_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index 1c7b61480e..1439efb42a 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -239,7 +239,7 @@ static void milkymist_uart_class_init(ObjectClass *klass, void *data)
dc->realize = milkymist_uart_realize;
dc->reset = milkymist_uart_reset;
dc->vmsd = &vmstate_milkymist_uart;
- dc->props = milkymist_uart_properties;
+ device_class_set_props(dc, milkymist_uart_properties);
}
static const TypeInfo milkymist_uart_info = {
diff --git a/hw/char/nrf51_uart.c b/hw/char/nrf51_uart.c
index b67fd21089..d1fef77acd 100644
--- a/hw/char/nrf51_uart.c
+++ b/hw/char/nrf51_uart.c
@@ -314,7 +314,7 @@ static void nrf51_uart_class_init(ObjectClass *klass, void *data)
dc->reset = nrf51_uart_reset;
dc->realize = nrf51_uart_realize;
- dc->props = nrf51_uart_properties;
+ device_class_set_props(dc, nrf51_uart_properties);
dc->vmsd = &nrf51_uart_vmstate;
}
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 40174eeda1..8dd67d1375 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -627,7 +627,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data)
dc->realize = parallel_isa_realizefn;
dc->vmsd = &vmstate_parallel_isa;
- dc->props = parallel_isa_properties;
+ device_class_set_props(dc, parallel_isa_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index 23cd544cc5..13e784f9d9 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -356,7 +356,7 @@ static void pl011_class_init(ObjectClass *oc, void *data)
dc->realize = pl011_realize;
dc->vmsd = &vmstate_pl011;
- dc->props = pl011_properties;
+ device_class_set_props(dc, pl011_properties);
}
static const TypeInfo pl011_arm_info = {
diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 392606259d..c420dc066e 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -342,7 +342,7 @@ static void console_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
SCLPEventClass *ec = SCLP_EVENT_CLASS(klass);
- dc->props = console_properties;
+ device_class_set_props(dc, console_properties);
dc->reset = console_reset;
dc->vmsd = &vmstate_sclplmconsole;
ec->init = console_init;
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index da126f0133..1fa124dab9 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -258,7 +258,7 @@ static void console_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
SCLPEventClass *ec = SCLP_EVENT_CLASS(klass);
- dc->props = console_properties;
+ device_class_set_props(dc, console_properties);
dc->reset = console_reset;
dc->vmsd = &vmstate_sclpconsole;
ec->init = console_init;
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index db8644551e..f9b6eed783 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -106,7 +106,7 @@ static void serial_isa_class_initfn(ObjectClass *klass, void *data)
dc->realize = serial_isa_realizefn;
dc->vmsd = &vmstate_isa_serial;
- dc->props = serial_isa_properties;
+ device_class_set_props(dc, serial_isa_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c
index e343a1235c..1742cb77ec 100644
--- a/hw/char/serial-pci-multi.c
+++ b/hw/char/serial-pci-multi.c
@@ -161,7 +161,7 @@ static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *data)
pc->revision = 1;
pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL;
dc->vmsd = &vmstate_pci_multi_serial;
- dc->props = multi_2x_serial_pci_properties;
+ device_class_set_props(dc, multi_2x_serial_pci_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
@@ -176,7 +176,7 @@ static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data)
pc->revision = 1;
pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL;
dc->vmsd = &vmstate_pci_multi_serial;
- dc->props = multi_4x_serial_pci_properties;
+ device_class_set_props(dc, multi_4x_serial_pci_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index b6a73c65a9..743552c56b 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -100,7 +100,7 @@ static void serial_pci_class_initfn(ObjectClass *klass, void *data)
pc->revision = 1;
pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL;
dc->vmsd = &vmstate_pci_serial;
- dc->props = serial_pci_properties;
+ device_class_set_props(dc, serial_pci_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
diff --git a/hw/char/serial.c b/hw/char/serial.c
index d167c43d40..9298881af9 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -1044,7 +1044,7 @@ static void serial_class_init(ObjectClass *klass, void* data)
dc->realize = serial_realize;
dc->unrealize = serial_unrealize;
dc->vmsd = &vmstate_serial;
- dc->props = serial_properties;
+ device_class_set_props(dc, serial_properties);
}
static const TypeInfo serial_info = {
@@ -1159,7 +1159,7 @@ static void serial_mm_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
- dc->props = serial_mm_properties;
+ device_class_set_props(dc, serial_mm_properties);
dc->realize = serial_mm_realize;
}
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index 8f4d9fe472..ecb94f5673 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -193,7 +193,7 @@ static void spapr_vty_class_init(ObjectClass *klass, void *data)
k->dt_type = "serial";
k->dt_compatible = "hvterm1";
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
- dc->props = spapr_vty_properties;
+ device_class_set_props(dc, spapr_vty_properties);
dc->vmsd = &vmstate_spapr_vty;
}
diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usart.c
index 4ec843de38..0d661be6d3 100644
--- a/hw/char/stm32f2xx_usart.c
+++ b/hw/char/stm32f2xx_usart.c
@@ -222,7 +222,7 @@ static void stm32f2xx_usart_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->reset = stm32f2xx_usart_reset;
- dc->props = stm32f2xx_usart_properties;
+ device_class_set_props(dc, stm32f2xx_usart_properties);
dc->realize = stm32f2xx_usart_realize;
}
diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c
index f7aba12565..2c47ebf007 100644
--- a/hw/char/terminal3270.c
+++ b/hw/char/terminal3270.c
@@ -288,7 +288,7 @@ static void terminal_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
EmulatedCcw3270Class *ck = EMULATED_CCW_3270_CLASS(klass);
- dc->props = terminal_properties;
+ device_class_set_props(dc, terminal_properties);
dc->vmsd = &terminal3270_vmstate;
ck->init = terminal_init;
ck->read_payload_3270 = read_payload_3270;
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index a7d34fe0ed..b010c21de4 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -287,7 +287,7 @@ static void virtserialport_class_init(ObjectClass *klass, void *data)
k->set_guest_connected = set_guest_connected;
k->enable_backend = virtconsole_enable_backend;
k->guest_writable = guest_writable;
- dc->props = virtserialport_properties;
+ device_class_set_props(dc, virtserialport_properties);
}
static const TypeInfo virtserialport_info = {
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index e1cbce3ba3..941ed5aca9 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -1110,7 +1110,7 @@ static void virtio_serial_port_class_init(ObjectClass *klass, void *data)
k->bus_type = TYPE_VIRTIO_SERIAL_BUS;
k->realize = virtser_port_device_realize;
k->unrealize = virtser_port_device_unrealize;
- k->props = virtser_props;
+ device_class_set_props(k, virtser_props);
}
static const TypeInfo virtio_serial_port_type_info = {
@@ -1179,7 +1179,7 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data)
QLIST_INIT(&vserdevices.devices);
- dc->props = virtio_serial_properties;
+ device_class_set_props(dc, virtio_serial_properties);
dc->vmsd = &vmstate_virtio_console;
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
vdc->realize = virtio_serial_device_realize;
diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c
index aa6bf02e21..c6512285d7 100644
--- a/hw/char/xilinx_uartlite.c
+++ b/hw/char/xilinx_uartlite.c
@@ -236,7 +236,7 @@ static void xilinx_uartlite_class_init(ObjectClass *klass, void *data)
dc->reset = xilinx_uartlite_reset;
dc->realize = xilinx_uartlite_realize;
- dc->props = xilinx_uartlite_properties;
+ device_class_set_props(dc, xilinx_uartlite_properties);
}
static const TypeInfo xilinx_uartlite_info = {