ppc/pnv: Simplify pnv_bmc_create()
and reuse pnv_bmc_set_pnor() to share the setting of the PNOR. Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20210126171059.307867-5-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
05ce9b73b8
commit
60ef80101e
|
@ -260,13 +260,8 @@ IPMIBmc *pnv_bmc_create(PnvPnor *pnor)
|
||||||
Object *obj;
|
Object *obj;
|
||||||
|
|
||||||
obj = object_new(TYPE_IPMI_BMC_SIMULATOR);
|
obj = object_new(TYPE_IPMI_BMC_SIMULATOR);
|
||||||
object_ref(OBJECT(pnor));
|
|
||||||
object_property_add_const_link(obj, "pnor", OBJECT(pnor));
|
|
||||||
qdev_realize(DEVICE(obj), NULL, &error_fatal);
|
qdev_realize(DEVICE(obj), NULL, &error_fatal);
|
||||||
|
pnv_bmc_set_pnor(IPMI_BMC(obj), pnor);
|
||||||
/* Install the HIOMAP protocol handlers to access the PNOR */
|
|
||||||
ipmi_sim_register_netfn(IPMI_BMC_SIMULATOR(obj), IPMI_NETFN_OEM,
|
|
||||||
&hiomap_netfn);
|
|
||||||
|
|
||||||
return IPMI_BMC(obj);
|
return IPMI_BMC(obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue