aboutsummaryrefslogtreecommitdiff
path: root/hw/phb4.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2017-07-20 16:22:17 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-07-25 15:42:30 +1000
commit61129e82527f7a960756e3f9a9d5701d9e7623c8 (patch)
tree7f3a95232cea958be1a0964a8aa3485d557b20b4 /hw/phb4.c
parentb42ff2b904165addf32e77679cebb94a08086966 (diff)
downloadskiboot-61129e82527f7a960756e3f9a9d5701d9e7623c8.zip
skiboot-61129e82527f7a960756e3f9a9d5701d9e7623c8.tar.gz
skiboot-61129e82527f7a960756e3f9a9d5701d9e7623c8.tar.bz2
phb4: Simplify calling phb4_retry_state()
phb4_retry_state() returns a good error code, so just use that rather than complicating the caller. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/phb4.c')
-rw-r--r--hw/phb4.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index da1eaa1..f72eb6f 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2188,7 +2188,6 @@ static int64_t phb4_poll_link(struct pci_slot *slot)
{
struct phb4 *p = phb_to_phb4(slot->phb);
uint64_t reg;
- int64_t rc;
switch (slot->state) {
case PHB4_SLOT_NORMAL:
@@ -2220,12 +2219,7 @@ static int64_t phb4_poll_link(struct pci_slot *slot)
if (slot->retries-- == 0) {
PHBERR(p, "LINK: Timeout waiting for electrical link\n");
PHBDBG(p, "LINK: DLP train control: 0x%016llx\n", reg);
- rc = phb4_retry_state(slot);
- if (rc >= OPAL_SUCCESS)
- return rc;
-
- pci_slot_set_state(slot, PHB4_SLOT_NORMAL);
- return OPAL_SUCCESS;
+ return phb4_retry_state(slot);
}
return pci_slot_set_sm_timeout(slot, msecs_to_tb(100));
case PHB4_SLOT_LINK_WAIT:
@@ -2241,9 +2235,7 @@ static int64_t phb4_poll_link(struct pci_slot *slot)
if (slot->retries-- == 0) {
PHBERR(p, "LINK: Timeout waiting for link up\n");
PHBDBG(p, "LINK: DLP train control: 0x%016llx\n", reg);
- rc = phb4_retry_state(slot);
- if (rc >= OPAL_SUCCESS)
- return rc;
+ return phb4_retry_state(slot);
pci_slot_set_state(slot, PHB4_SLOT_NORMAL);
return OPAL_SUCCESS;