aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/pci-uclass.c
diff options
context:
space:
mode:
authorSuneel Garapati <sgarapati@marvell.com>2020-05-04 21:25:25 -0700
committerStefan Roese <sr@denx.de>2020-08-25 08:01:16 +0200
commitf0c369284d8da6691d3895d9d9d83015c141008a (patch)
tree24bb22e46dff69903f3e3567b161c2aedf1fbf8f /drivers/pci/pci-uclass.c
parenta3fac3f395afc5ad7aeb01fb7ed2d87d07c87ab0 (diff)
downloadu-boot-f0c369284d8da6691d3895d9d9d83015c141008a.zip
u-boot-f0c369284d8da6691d3895d9d9d83015c141008a.tar.gz
u-boot-f0c369284d8da6691d3895d9d9d83015c141008a.tar.bz2
pci: pci-uclass: Check validity of ofnode
Add check if the referenced ofnode is valid. 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/pci-uclass.c')
-rw-r--r--drivers/pci/pci-uclass.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index fc60dfe..d8a6647 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -539,7 +539,8 @@ int pci_auto_config_devices(struct udevice *bus)
int ret;
debug("%s: device %s\n", __func__, dev->name);
- if (dev_read_bool(dev, "pci,no-autoconfig"))
+ if (dev_of_valid(dev) &&
+ dev_read_bool(dev, "pci,no-autoconfig"))
continue;
ret = dm_pciauto_config_device(dev);
if (ret < 0)
@@ -1025,8 +1026,11 @@ static int pci_uclass_pre_probe(struct udevice *bus)
hose->bus = bus;
hose->first_busno = bus->seq;
hose->last_busno = bus->seq;
- hose->skip_auto_config_until_reloc =
- dev_read_bool(bus, "u-boot,skip-auto-config-until-reloc");
+ if (dev_of_valid(bus)) {
+ hose->skip_auto_config_until_reloc =
+ dev_read_bool(bus,
+ "u-boot,skip-auto-config-until-reloc");
+ }
return 0;
}