/* Return 1 (true) if link training ends up with link up success. Return 0 (false) if link training ends up with link up failure.  */
static int pcie_advk_wait_for_link(struct pcie_advk *pcie)
/* Return 1 (true) if link training ends up with link up success. Return 0 (false) if link training ends up with link up failure.  */
static int pcie_advk_wait_for_link(struct pcie_advk *pcie)
{
	int retries;
	for (retries = 0; retries < MAX_RETRIES; retries++) {
		if (pcie_advk_link_up(pcie)) {
			printf("PCIE-%d: Link up\n", pcie->first_busno);
			return 0;
		}
		udelay(LINK_WAIT_TIMEOUT);
	}
	printf("PCIE-%d: Link down\n", pcie->first_busno);
	return -ETIMEDOUT;
}