mirror of https://github.com/RT-Thread/rt-thread
[DM/Platform] Fixup the node will probe more than once
If a node request a new node or it's parent node. the request's node will probe a double time. So we check the device object of node in ofw probe entry and ofw probe child exit.
This commit is contained in:
parent
b0e7cba9fd
commit
fc86cb9427
|
@ -117,6 +117,12 @@ static rt_err_t platform_ofw_device_probe_once(struct rt_ofw_node *parent_np)
|
|||
struct rt_ofw_node_id *id;
|
||||
struct rt_ofw_prop *compat_prop = RT_NULL;
|
||||
|
||||
if (np->dev)
|
||||
{
|
||||
/* Check first */
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG_D("%s found in %s", np->full_name, parent_np->full_name);
|
||||
|
||||
/* Is system node or have driver */
|
||||
|
@ -151,6 +157,12 @@ static rt_err_t platform_ofw_device_probe_once(struct rt_ofw_node *parent_np)
|
|||
}
|
||||
}
|
||||
|
||||
if (np->dev)
|
||||
{
|
||||
/* Maybe the childs have requested this node */
|
||||
continue;
|
||||
}
|
||||
|
||||
pdev = alloc_ofw_platform_device(np);
|
||||
|
||||
if (!pdev)
|
||||
|
|
Loading…
Reference in New Issue