summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorSuneel Garapati <sgarapati@marvell.com>2019-10-20 02:02:48 +0300
committerStefan Roese <sr@denx.de>2020-08-25 06:41:09 +0300
commitbc30140d20d041a6ed5d52175e9953c36f8f5473 (patch)
tree8bd475dc362c27d31cb74750af76a18b51bdac47 /drivers/pci
parentb3699a13a675e06f2b27569cfc94f0a3ad8505cc (diff)
downloadu-boot-bc30140d20d041a6ed5d52175e9953c36f8f5473.tar.xz
pci: pci-uclass: Make DT subnode parse optional
Parse subnode DT properties only if parent node is valid. Otherwise, assert is triggered on ofnode_valid in ofnode_first_subnode from dev_for_each_subnode. Signed-off-by: Suneel Garapati <sgarapati@marvell.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci-uclass.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index fde5b83adf..cf1bbccbba 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -696,7 +696,8 @@ static int pci_find_and_bind_driver(struct udevice *parent,
find_id->vendor, find_id->device);
/* Determine optional OF node */
- pci_dev_find_ofnode(parent, bdf, &node);
+ if (ofnode_valid(dev_ofnode(parent)))
+ pci_dev_find_ofnode(parent, bdf, &node);
if (ofnode_valid(node) && !ofnode_is_available(node)) {
debug("%s: Ignoring disabled device\n", __func__);