Wei Jiangang <weijg.f...@cn.fujitsu.com> writes: > Signed-off-by: Wei Jiangang <weijg.f...@cn.fujitsu.com> > Signed-off-by: Cao jin <caoj.f...@cn.fujitsu.com> > --- > hw/pci-bridge/pci_expander_bridge.c | 18 +++++------------- > 1 file changed, 5 insertions(+), 13 deletions(-) > > diff --git a/hw/pci-bridge/pci_expander_bridge.c > b/hw/pci-bridge/pci_expander_bridge.c > index ce5baf8..cc5074d 100644 > --- a/hw/pci-bridge/pci_expander_bridge.c > +++ b/hw/pci-bridge/pci_expander_bridge.c > @@ -267,22 +267,14 @@ err_register_bus: > object_unref(OBJECT(ds)); > } > > -static int pxb_dev_initfn(PCIDevice *dev) > +static void pxb_dev_realize(PCIDevice *dev, Error **errp) > { > - Error *err = NULL; > - > if (pci_bus_is_express(dev->bus)) { > - error_report("pxb devices cannot reside on a PCIe bus!"); > - return -EINVAL; > - } > - > - pxb_dev_realize_common(dev, false, &err); > - if (err) { > - error_report_err(err); > - return -EINVAL; > + error_setg(errp, "pxb devices cannot reside on a PCIe bus!");
Suggest to use the occasion to drop the exclamation mark. > + return; > } > > - return 0; > + pxb_dev_realize_common(dev, false, errp); > } > > static void pxb_dev_exitfn(PCIDevice *pci_dev) > @@ -304,7 +296,7 @@ static void pxb_dev_class_init(ObjectClass *klass, void > *data) > DeviceClass *dc = DEVICE_CLASS(klass); > PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); > > - k->init = pxb_dev_initfn; > + k->realize = pxb_dev_realize; > k->exit = pxb_dev_exitfn; > k->vendor_id = PCI_VENDOR_ID_REDHAT; > k->device_id = PCI_DEVICE_ID_REDHAT_PXB;