Skip to content

Commit

Permalink
phb4: Simplify calling phb4_retry_state()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mikey authored and stewartsmith committed Jul 25, 2017
1 parent b42ff2b commit 61129e8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions hw/phb4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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;
Expand Down

0 comments on commit 61129e8

Please sign in to comment.