mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
dm: core: Add a uclass pre_probe() method for devices
Some uclasses want to set up a device before it is probed. Add a method for this. An example is with PCI, where a PCI uclass wants to set up its private data for later use. This allows the device's uclass() method to make calls whcih use that data (for example, read PCI memory regions from device tree, set up bus numbers). Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
02eeb1bbb1
commit
02c07b3741
7 changed files with 35 additions and 6 deletions
|
@ -391,9 +391,17 @@ int uclass_resolve_seq(struct udevice *dev)
|
|||
return seq;
|
||||
}
|
||||
|
||||
int uclass_pre_probe_child(struct udevice *dev)
|
||||
int uclass_pre_probe_device(struct udevice *dev)
|
||||
{
|
||||
struct uclass_driver *uc_drv;
|
||||
int ret;
|
||||
|
||||
uc_drv = dev->uclass->uc_drv;
|
||||
if (uc_drv->pre_probe) {
|
||||
ret = uc_drv->pre_probe(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!dev->parent)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue