diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2016-06-10 15:03:41 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-06-14 16:00:16 +1000 |
commit | 0bf9c3c44bf1bde1c7bec86d33a6e3ccb6e56c90 (patch) | |
tree | 249a264686be313a00fbbc345722f47d1db025ec /hw/p7ioc-phb.c | |
parent | cc406eb92d69690e26c3c5f52f48060c6c8c0b43 (diff) | |
download | talos-skiboot-0bf9c3c44bf1bde1c7bec86d33a6e3ccb6e56c90.tar.gz talos-skiboot-0bf9c3c44bf1bde1c7bec86d33a6e3ccb6e56c90.zip |
core/pci: Return value for struct phb_ops::device_init
This adds @data argument and "int" return value for struct phb_ops::
device_init() so that it can be called in pci_walk_dev() directly to
reinitialize the PCI devices behind the specified slot in subsequent
patches.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/p7ioc-phb.c')
-rw-r--r-- | hw/p7ioc-phb.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c index 9edf134d..3ef3137a 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; } |