[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/10] pnv_phb4_pec.c: move phb4 properties setup to pec_reali
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v3 05/10] pnv_phb4_pec.c: move phb4 properties setup to pec_realize() |
Date: |
Mon, 10 Jan 2022 11:33:41 -0300 |
Previous patch added stack->phb->index handling in pec_realize() for
specific reasons (phb->index is reliant on the stack index in
pec->stacks[]).
Move pnv_phb4_set_stack_phb_props() from stk_realize() to pec_realize()
to have a single spot in which we set PHB4 properties for the default
created stack->phb. This will give us one less spot to worry about when
introducing user creatable pnv-phb4s and having to deal with stack->phb
being NULL depending on -nodefaults being set.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/pci-host/pnv_phb4_pec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index 417fac4cef..d2851e8040 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -405,6 +405,7 @@ static void pnv_pec_realize(DeviceState *dev, Error **errp)
*/
object_property_set_int(OBJECT(&stack->phb), "index", phb_id,
&error_abort);
+ pnv_phb4_set_stack_phb_props(stack, &stack->phb);
if (!qdev_realize(DEVICE(stk_obj), NULL, errp)) {
return;
@@ -576,7 +577,6 @@ static void pnv_pec_stk_realize(DeviceState *dev, Error
**errp)
pnv_xscom_region_init(&stack->phb_regs_mr, OBJECT(&stack->phb),
&pnv_phb4_xscom_ops, &stack->phb, name, 0x40);
- pnv_phb4_set_stack_phb_props(stack, &stack->phb);
if (!sysbus_realize(SYS_BUS_DEVICE(&stack->phb), errp)) {
return;
}
--
2.33.1
- [PATCH v3 00/10] user creatable pnv-phb4 devices, Daniel Henrique Barboza, 2022/01/10
- [PATCH v3 05/10] pnv_phb4_pec.c: move phb4 properties setup to pec_realize(),
Daniel Henrique Barboza <=
- [PATCH v3 06/10] ppc/pnv: turn 'phb' into a pointer in struct PnvPhb4PecStack, Daniel Henrique Barboza, 2022/01/10
- [PATCH v3 07/10] ppc/pnv: move PHB4 related XSCOM init to phb4_realize(), Daniel Henrique Barboza, 2022/01/10
- [PATCH v3 08/10] pnv_phb4.c: check stack->phb not NULL in phb4_update_regions(), Daniel Henrique Barboza, 2022/01/10
- [PATCH v3 09/10] ppc/pnv: Introduce user creatable pnv-phb4 devices, Daniel Henrique Barboza, 2022/01/10