diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-12-16 21:18:56 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-01-08 16:28:48 +0100 |
commit | 0943e1a3fb120360719a7bcd31bfd15e18af09b5 (patch) | |
tree | cf04f9688cf6eab214257e03a7949e7f2fdc3bd8 /drivers | |
parent | ae52617d977259e7c7a9a6f8cc449899398ef14b (diff) | |
download | barebox-0943e1a3fb120360719a7bcd31bfd15e18af09b5.tar.gz barebox-0943e1a3fb120360719a7bcd31bfd15e18af09b5.tar.xz |
PCI: imx6: Add local struct device pointers
Port of a Linux commit 13957652f7242a8cb02ffb8c96f412f62c486ee1
Use a local "struct device *dev" for brevity and consistency with other
drivers. No functional change intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci-imx6.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/pci/pci-imx6.c b/drivers/pci/pci-imx6.c index c499f4c836..0ede1abfaf 100644 --- a/drivers/pci/pci-imx6.c +++ b/drivers/pci/pci-imx6.c @@ -401,6 +401,7 @@ static int imx6_pcie_wait_for_link(struct pcie_port *pp) static int imx6_pcie_wait_for_speed_change(struct pcie_port *pp) { + struct device_d *dev = pp->dev; uint32_t tmp; uint64_t start = get_time_ns(); @@ -411,7 +412,7 @@ static int imx6_pcie_wait_for_speed_change(struct pcie_port *pp) return 0; } - dev_err(pp->dev, "Speed change timeout\n"); + dev_err(dev, "Speed change timeout\n"); return -EINVAL; } @@ -419,6 +420,7 @@ static int imx6_pcie_wait_for_speed_change(struct pcie_port *pp) static int imx6_pcie_establish_link(struct pcie_port *pp) { struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); + struct device_d *dev = pp->dev; uint32_t tmp; int ret; u32 gpr12; @@ -440,7 +442,7 @@ static int imx6_pcie_establish_link(struct pcie_port *pp) ret = imx6_pcie_wait_for_link(pp); if (ret) { - dev_info(pp->dev, "Link never came up\n"); + dev_info(dev, "Link never came up\n"); goto err_reset_phy; } @@ -460,24 +462,24 @@ static int imx6_pcie_establish_link(struct pcie_port *pp) ret = imx6_pcie_wait_for_speed_change(pp); if (ret) { - dev_err(pp->dev, "Failed to bring link up!\n"); + dev_err(dev, "Failed to bring link up!\n"); goto err_reset_phy; } /* Make sure link training is finished as well! */ ret = imx6_pcie_wait_for_link(pp); if (ret) { - dev_err(pp->dev, "Failed to bring link up!\n"); + dev_err(dev, "Failed to bring link up!\n"); goto err_reset_phy; } tmp = readl(pp->dbi_base + PCIE_RC_LCSR); - dev_dbg(pp->dev, "Link up, Gen=%i\n", (tmp >> 16) & 0xf); + dev_dbg(dev, "Link up, Gen=%i\n", (tmp >> 16) & 0xf); return 0; err_reset_phy: - dev_dbg(pp->dev, "PHY DEBUG_R0=0x%08x DEBUG_R1=0x%08x\n", + dev_dbg(dev, "PHY DEBUG_R0=0x%08x DEBUG_R1=0x%08x\n", readl(pp->dbi_base + PCIE_PHY_DEBUG_R0), readl(pp->dbi_base + PCIE_PHY_DEBUG_R1)); imx6_pcie_reset_phy(pp); @@ -500,6 +502,7 @@ static void imx6_pcie_host_init(struct pcie_port *pp) static int imx6_pcie_link_up(struct pcie_port *pp) { + struct device_d *dev = pp->dev; u32 rc; int count = 5; @@ -527,7 +530,7 @@ static int imx6_pcie_link_up(struct pcie_port *pp) return 1; if (!count--) break; - dev_dbg(pp->dev, "Link is up, but still in training\n"); + dev_dbg(dev, "Link is up, but still in training\n"); /* * Wait a little bit, then re-check if the link finished * the training. |