aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/p7ioc-phb.c12
-rw-r--r--hw/phb3.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
index 9edf134..3ef3137 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -2179,7 +2179,9 @@ static void p7ioc_endpoint_init(struct phb *phb,
pci_cfg_write32(phb, bdfn, aercap + PCIECAP_AER_CAPCTL, val32);
}
-static void p7ioc_device_init(struct phb *phb, struct pci_device *dev)
+static int p7ioc_device_init(struct phb *phb,
+ struct pci_device *dev,
+ void *data __unused)
{
int ecap = 0;
int aercap = 0;
@@ -2208,6 +2210,8 @@ static void p7ioc_device_init(struct phb *phb, struct pci_device *dev)
p7ioc_switch_port_init(phb, dev, ecap, aercap);
else
p7ioc_endpoint_init(phb, dev, ecap, aercap);
+
+ return 0;
}
static int64_t p7ioc_pci_reinit(struct phb *phb,
@@ -2215,6 +2219,7 @@ static int64_t p7ioc_pci_reinit(struct phb *phb,
{
struct pci_device *pd;
uint16_t bdfn = data;
+ int ret;
if (scope != OPAL_REINIT_PCI_DEV)
return OPAL_PARAMETER;
@@ -2223,7 +2228,10 @@ static int64_t p7ioc_pci_reinit(struct phb *phb,
if (!pd)
return OPAL_PARAMETER;
- p7ioc_device_init(phb, pd);
+ ret = p7ioc_device_init(phb, pd, NULL);
+ if (ret)
+ return OPAL_HARDWARE;
+
return OPAL_SUCCESS;
}
diff --git a/hw/phb3.c b/hw/phb3.c
index 110d9f2..026a97a 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -526,7 +526,9 @@ static void phb3_check_device_quirks(struct phb *phb, struct pci_device *dev)
}
}
-static void phb3_device_init(struct phb *phb, struct pci_device *dev)
+static int phb3_device_init(struct phb *phb,
+ struct pci_device *dev,
+ void *data __unused)
{
int ecap = 0;
int aercap = 0;
@@ -558,12 +560,15 @@ static void phb3_device_init(struct phb *phb, struct pci_device *dev)
phb3_switch_port_init(phb, dev, ecap, aercap);
else
phb3_endpoint_init(phb, dev, ecap, aercap);
+
+ return 0;
}
static int64_t phb3_pci_reinit(struct phb *phb, uint64_t scope, uint64_t data)
{
struct pci_device *pd;
uint16_t bdfn = data;
+ int ret;
if (scope != OPAL_REINIT_PCI_DEV)
return OPAL_PARAMETER;
@@ -572,7 +577,10 @@ static int64_t phb3_pci_reinit(struct phb *phb, uint64_t scope, uint64_t data)
if (!pd)
return OPAL_PARAMETER;
- phb3_device_init(phb, pd);
+ ret = phb3_device_init(phb, pd, NULL);
+ if (ret)
+ return OPAL_HARDWARE;
+
return OPAL_SUCCESS;
}