mirror of
https://xff.cz/git/u-boot/
synced 2025-08-31 16:22:36 +02:00
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>
This commit is contained in:
committed by
Stefan Roese
parent
a3fac3f395
commit
f0c369284d
@@ -539,7 +539,8 @@ int pci_auto_config_devices(struct udevice *bus)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
debug("%s: device %s\n", __func__, dev->name);
|
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;
|
continue;
|
||||||
ret = dm_pciauto_config_device(dev);
|
ret = dm_pciauto_config_device(dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -1025,8 +1026,11 @@ static int pci_uclass_pre_probe(struct udevice *bus)
|
|||||||
hose->bus = bus;
|
hose->bus = bus;
|
||||||
hose->first_busno = bus->seq;
|
hose->first_busno = bus->seq;
|
||||||
hose->last_busno = bus->seq;
|
hose->last_busno = bus->seq;
|
||||||
hose->skip_auto_config_until_reloc =
|
if (dev_of_valid(bus)) {
|
||||||
dev_read_bool(bus, "u-boot,skip-auto-config-until-reloc");
|
hose->skip_auto_config_until_reloc =
|
||||||
|
dev_read_bool(bus,
|
||||||
|
"u-boot,skip-auto-config-until-reloc");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user