[PATCH 21/30] PCI: tegra: Add "pci" type check before parsing child device tree node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Each root port is added as a child device tree node of PCIe controller
node. These child nodes are parsed using open firmware PCI bus accessor
functions. If the child node is not of "pci" type then device tree
parsing fails. Add "pci" type check before parsing child device tree node.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@xxxxxxxxxx>
---
 drivers/pci/controller/pci-tegra.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 8fdc7934d4c9..d08a63132c77 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -2197,6 +2197,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
 		unsigned int index;
 		u32 value;
 
+		if (!of_node_is_type(port, "pci"))
+			continue;
+
 		err = of_pci_get_devfn(port);
 		if (err < 0) {
 			dev_err(dev, "failed to parse address: %d\n", err);
-- 
2.17.1




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux