diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-06-03 00:47:17 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-06-10 21:52:59 +0300 |
commit | 6cbb247e85eb4449d31a8dcb9b3f0464772b1395 (patch) | |
tree | 4a73b6883501b2ec7dba50fdc377c1fc60c961c2 /drivers/pci/host/pci-layerscape.c | |
parent | 1d3f9bac716a09af2d5d6e8601336ec9efcdccda (diff) | |
download | linux-6cbb247e85eb4449d31a8dcb9b3f0464772b1395.tar.xz |
PCI: designware: Wait for link to come up with consistent style
All the DesignWare-based host drivers loop waiting for the link to come up,
but they do it several ways that are needlessly different.
Wait for the link to come up in a consistent style across all the
DesignWare drivers. No functional change.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
Diffstat (limited to 'drivers/pci/host/pci-layerscape.c')
-rw-r--r-- | drivers/pci/host/pci-layerscape.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c index 434b116f1a7e..b2328ea13dcf 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) |