change type of pci_bridge_initfn() to void
Since it can`t fail. Also modify the callers. Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
This commit is contained in:
parent
33c28f3bde
commit
9cfaa0079f
@ -62,10 +62,7 @@ static int i82801b11_bridge_initfn(PCIDevice *d)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = pci_bridge_initfn(d, TYPE_PCI_BUS);
|
||||
if (rc < 0) {
|
||||
return rc;
|
||||
}
|
||||
pci_bridge_initfn(d, TYPE_PCI_BUS);
|
||||
|
||||
rc = pci_bridge_ssvid_init(d, I82801ba_SSVID_OFFSET,
|
||||
I82801ba_SSVID_SVID, I82801ba_SSVID_SSID);
|
||||
|
@ -98,11 +98,7 @@ static int ioh3420_initfn(PCIDevice *d)
|
||||
PCIESlot *s = PCIE_SLOT(d);
|
||||
int rc;
|
||||
|
||||
rc = pci_bridge_initfn(d, TYPE_PCIE_BUS);
|
||||
if (rc < 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
pci_bridge_initfn(d, TYPE_PCIE_BUS);
|
||||
pcie_port_init_reg(d);
|
||||
|
||||
rc = pci_bridge_ssvid_init(d, IOH_EP_SSVID_OFFSET,
|
||||
|
@ -53,10 +53,8 @@ static int pci_bridge_dev_initfn(PCIDevice *dev)
|
||||
PCIBridgeDev *bridge_dev = PCI_BRIDGE_DEV(dev);
|
||||
int err;
|
||||
|
||||
err = pci_bridge_initfn(dev, TYPE_PCI_BUS);
|
||||
if (err) {
|
||||
goto bridge_error;
|
||||
}
|
||||
pci_bridge_initfn(dev, TYPE_PCI_BUS);
|
||||
|
||||
if (bridge_dev->flags & (1 << PCI_BRIDGE_DEV_F_SHPC_REQ)) {
|
||||
dev->config[PCI_INTERRUPT_PIN] = 0x1;
|
||||
memory_region_init(&bridge_dev->bar, OBJECT(dev), "shpc-bar",
|
||||
@ -95,7 +93,7 @@ slotid_error:
|
||||
}
|
||||
shpc_error:
|
||||
pci_bridge_exitfn(dev);
|
||||
bridge_error:
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -61,11 +61,7 @@ static int xio3130_downstream_initfn(PCIDevice *d)
|
||||
PCIESlot *s = PCIE_SLOT(d);
|
||||
int rc;
|
||||
|
||||
rc = pci_bridge_initfn(d, TYPE_PCIE_BUS);
|
||||
if (rc < 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
pci_bridge_initfn(d, TYPE_PCIE_BUS);
|
||||
pcie_port_init_reg(d);
|
||||
|
||||
rc = msi_init(d, XIO3130_MSI_OFFSET, XIO3130_MSI_NR_VECTOR,
|
||||
|
@ -57,11 +57,7 @@ static int xio3130_upstream_initfn(PCIDevice *d)
|
||||
PCIEPort *p = PCIE_PORT(d);
|
||||
int rc;
|
||||
|
||||
rc = pci_bridge_initfn(d, TYPE_PCIE_BUS);
|
||||
if (rc < 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
pci_bridge_initfn(d, TYPE_PCIE_BUS);
|
||||
pcie_port_init_reg(d);
|
||||
|
||||
rc = msi_init(d, XIO3130_MSI_OFFSET, XIO3130_MSI_NR_VECTOR,
|
||||
|
@ -635,12 +635,7 @@ static void pci_apb_set_irq(void *opaque, int irq_num, int level)
|
||||
|
||||
static int apb_pci_bridge_initfn(PCIDevice *dev)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = pci_bridge_initfn(dev, TYPE_PCI_BUS);
|
||||
if (rc < 0) {
|
||||
return rc;
|
||||
}
|
||||
pci_bridge_initfn(dev, TYPE_PCI_BUS);
|
||||
|
||||
/*
|
||||
* command register:
|
||||
|
@ -333,7 +333,7 @@ void pci_bridge_reset(DeviceState *qdev)
|
||||
}
|
||||
|
||||
/* default qdev initialization function for PCI-to-PCI bridge */
|
||||
int pci_bridge_initfn(PCIDevice *dev, const char *typename)
|
||||
void pci_bridge_initfn(PCIDevice *dev, const char *typename)
|
||||
{
|
||||
PCIBus *parent = dev->bus;
|
||||
PCIBridge *br = PCI_BRIDGE(dev);
|
||||
@ -379,7 +379,6 @@ int pci_bridge_initfn(PCIDevice *dev, const char *typename)
|
||||
br->windows = pci_bridge_region_init(br);
|
||||
QLIST_INIT(&sec_bus->child);
|
||||
QLIST_INSERT_HEAD(&parent->child, sec_bus, sibling);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* default qdev clean up function for PCI-to-PCI bridge */
|
||||
|
@ -48,7 +48,7 @@ void pci_bridge_disable_base_limit(PCIDevice *dev);
|
||||
void pci_bridge_reset_reg(PCIDevice *dev);
|
||||
void pci_bridge_reset(DeviceState *qdev);
|
||||
|
||||
int pci_bridge_initfn(PCIDevice *pci_dev, const char *typename);
|
||||
void pci_bridge_initfn(PCIDevice *pci_dev, const char *typename);
|
||||
void pci_bridge_exitfn(PCIDevice *pci_dev);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user