mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 21:51:31 +00:00
dm: core: Allocate parent data separate from probing parent
At present the parent is probed before the child's ofdata_to_platdata() method is called. Adjust the logic slightly so that probing parents is not done until afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
29f7d05a34
commit
82de42fa14
1 changed files with 11 additions and 8 deletions
|
@ -346,7 +346,7 @@ int device_probe(struct udevice *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure all parents are probed */
|
/* Allocate parent data for this child */
|
||||||
if (dev->parent) {
|
if (dev->parent) {
|
||||||
size = dev->parent->driver->per_child_auto_alloc_size;
|
size = dev->parent->driver->per_child_auto_alloc_size;
|
||||||
if (!size) {
|
if (!size) {
|
||||||
|
@ -360,7 +360,17 @@ int device_probe(struct udevice *dev)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (drv->ofdata_to_platdata &&
|
||||||
|
(CONFIG_IS_ENABLED(OF_PLATDATA) || dev_has_of_node(dev))) {
|
||||||
|
ret = drv->ofdata_to_platdata(dev);
|
||||||
|
if (ret)
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure all parents are probed */
|
||||||
|
if (dev->parent) {
|
||||||
ret = device_probe(dev->parent);
|
ret = device_probe(dev->parent);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -375,13 +385,6 @@ int device_probe(struct udevice *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drv->ofdata_to_platdata &&
|
|
||||||
(CONFIG_IS_ENABLED(OF_PLATDATA) || dev_has_of_node(dev))) {
|
|
||||||
ret = drv->ofdata_to_platdata(dev);
|
|
||||||
if (ret)
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
seq = uclass_resolve_seq(dev);
|
seq = uclass_resolve_seq(dev);
|
||||||
if (seq < 0) {
|
if (seq < 0) {
|
||||||
ret = seq;
|
ret = seq;
|
||||||
|
|
Loading…
Add table
Reference in a new issue