summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorGUI <[email protected]>2025-03-18 12:28:04 +0800
committerRbb666 <[email protected]>2025-03-19 09:46:48 +0800
commitfc86cb94272b82e4160036b523bb9fd48103a0fa (patch)
tree5668dcb3a5c0a8f548bdc0bb25e5f0012a80af13 /components/drivers
parentb0e7cba9fddd45a4a51e228fc2f8721714bd7be9 (diff)
[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.
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/core/platform_ofw.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/drivers/core/platform_ofw.c b/components/drivers/core/platform_ofw.c
index 1b1aa2733a..dbe091935e 100644
--- a/components/drivers/core/platform_ofw.c
+++ b/components/drivers/core/platform_ofw.c
@@ -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)