[PATCH 3/3] PCI: rockchip: use local variable dev consistently

Shawn Lin shawn.lin at rock-chips.com
Wed Jun 28 18:22:49 PDT 2017


We have "struct device *dev" in rockchip_pcie_probe but
still fetch it from pdev and rockchip->dev somewhere.
This patch tries to improve and no functional change intended.

Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
---

 drivers/pci/host/pcie-rockchip.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index c545213..eb0a170 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -1482,15 +1482,14 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
 	if (err)
 		goto err_free_res;
 
-	rockchip->msg_region = devm_ioremap(rockchip->dev,
-					    rockchip->msg_bus_addr, SZ_1M);
+	rockchip->msg_region = devm_ioremap(dev, rockchip->msg_bus_addr, SZ_1M);
 	if (!rockchip->msg_region) {
 		err = -ENOMEM;
 		goto err_free_res;
 	}
 
 	list_splice_init(&res, &bridge->windows);
-	bridge->dev.parent = &pdev->dev;
+	bridge->dev.parent = dev;
 	bridge->sysdata = rockchip;
 	bridge->busnr = 0;
 	bridge->ops = &rockchip_pcie_ops;
-- 
1.9.1





More information about the Linux-rockchip mailing list