summaryrefslogtreecommitdiffstats
path: root/drivers/pci/host/pci-layerscape.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/host/pci-layerscape.c')
-rw-r--r--drivers/pci/host/pci-layerscape.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c
index 434b116..b2328ea1 100644
--- a/drivers/pci/host/pci-layerscape.c
+++ b/drivers/pci/host/pci-layerscape.c
@@ -64,18 +64,16 @@ static int ls_pcie_link_up(struct pcie_port *pp)
static int ls_pcie_establish_link(struct pcie_port *pp)
{
- int count = 0;
+ unsigned int retries;
- while (!dw_pcie_link_up(pp)) {
+ for (retries = 0; retries < 200; retries++) {
+ if (dw_pcie_link_up(pp))
+ return 0;
usleep_range(100, 1000);
- count++;
- if (count >= 200) {
- dev_err(pp->dev, "phy link never came up\n");
- return -EINVAL;
- }
}
- return 0;
+ dev_err(pp->dev, "phy link never came up\n");
+ return -EINVAL;
}
static void ls_pcie_host_init(struct pcie_port *pp)
OpenPOWER on IntegriCloud