[Skiboot] [PATCH 07/14] phb4: Simplify prepare_link_change() calls

Michael Neuling mikey at neuling.org
Wed Jul 26 20:50:06 AEST 2017


Just call phb4_prepare_link_change() rather than going through the
slot ops.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 hw/phb4.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index 12a05f44c3..c229dba874 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2224,8 +2224,7 @@ static int64_t phb4_retry_state(struct pci_slot *slot)
 	struct phb4 *p = phb_to_phb4(slot->phb);
 
 	/* Mark link as down */
-	if (slot->ops.prepare_link_change)
-		slot->ops.prepare_link_change(slot, false);
+	phb4_prepare_link_change(slot, false);
 
 	if (!slot->link_retries--) {
 		switch (slot->state) {
@@ -2408,8 +2407,7 @@ static int64_t phb4_poll_link(struct pci_slot *slot)
 		}
 		if (reg & PHB_PCIE_DLP_TL_LINKACT) {
 			PHBDBG(p, "LINK: Link is up\n");
-			if (slot->ops.prepare_link_change)
-				slot->ops.prepare_link_change(slot, true);
+			phb4_prepare_link_change(slot, true);
 			pci_slot_set_state(slot, PHB4_SLOT_LINK_STABLE);
 			slot->stable_retries = PHB4_LINK_STABLE_RETRIES;
 			return pci_slot_set_sm_timeout(slot, secs_to_tb(1));
@@ -2473,8 +2471,7 @@ static int64_t phb4_hreset(struct pci_slot *slot)
 		}
 
 		PHBDBG(p, "HRESET: Prepare for link down\n");
-		if (slot->ops.prepare_link_change)
-			slot->ops.prepare_link_change(slot, false);
+		phb4_prepare_link_change(slot, false);
 		/* fall through */
 	case PHB4_SLOT_HRESET_START:
 		PHBDBG(p, "HRESET: Assert\n");
@@ -2532,8 +2529,7 @@ static int64_t phb4_freset(struct pci_slot *slot)
 
 		PHBDBG(p, "FRESET: Prepare for link down\n");
 
-		if (slot->ops.prepare_link_change)
-			slot->ops.prepare_link_change(slot, false);
+		phb4_prepare_link_change(slot, false);
 		/* fall through */
 	case PHB4_SLOT_FRESET_START:
 		reg = in_be64(p->regs + PHB_PCIE_CRESET);
-- 
2.11.0



More information about the Skiboot mailing list