[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/5] hw/pci-host/raven: Set QDev properties using QDev API
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 2/5] hw/pci-host/raven: Set QDev properties using QDev API |
Date: |
Fri, 3 Feb 2023 22:16:20 +0100 |
No need to use the low-level QOM API when an object
inherits from QDev. Directly use the QDev API to set
its properties.
All calls use either errp=&error_fatal or NULL, so
converting to the QDev API is almost a no-op (QDev API
always uses &error_abort).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/pci-host/raven.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c
index cdfb62ac2e..2c842d2146 100644
--- a/hw/pci-host/raven.c
+++ b/hw/pci-host/raven.c
@@ -246,8 +246,7 @@ static void raven_pcihost_realizefn(DeviceState *d, Error
**errp)
/* According to PReP specification section 6.1.6 "System Interrupt
* Assignments", all PCI interrupts are routed via IRQ 15 */
s->or_irq = OR_IRQ(object_new(TYPE_OR_IRQ));
- object_property_set_int(OBJECT(s->or_irq), "num-lines", PCI_NUM_PINS,
- &error_fatal);
+ qdev_prop_set_uint16(DEVICE(s->or_irq), "num-lines", PCI_NUM_PINS);
qdev_realize(DEVICE(s->or_irq), NULL, &error_fatal);
sysbus_init_irq(dev, &s->or_irq->out_irq);
@@ -319,8 +318,7 @@ static void raven_pcihost_initfn(Object *obj)
object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_RAVEN_PCI_DEVICE);
pci_dev = DEVICE(&s->pci_dev);
- object_property_set_int(OBJECT(&s->pci_dev), "addr", PCI_DEVFN(0, 0),
- NULL);
+ qdev_prop_set_int32(pci_dev, "addr", PCI_DEVFN(0, 0));
qdev_prop_set_bit(pci_dev, "multifunction", false);
}
--
2.38.1
- [PATCH 0/5] hw/ppc: Set QDev properties using QDev API (part 2/3), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 1/5] hw/misc/macio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 3/5] hw/ppc/ppc4xx: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 2/5] hw/pci-host/raven: Set QDev properties using QDev API,
Philippe Mathieu-Daudé <=
- [PATCH 4/5] hw/ppc/spapr: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 5/5] hw/ppc/pnv: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- Re: [PATCH 0/5] hw/ppc: Set QDev properties using QDev API (part 2/3), Daniel Henrique Barboza, 2023/02/05
- Re: [PATCH 0/5] hw/ppc: Set QDev properties using QDev API (part 2/3), Cédric Le Goater, 2023/02/06