在 2025/2/12 13:52, Krzysztof Kozlowski 写道:
On 07/02/2025 02:31, Zhang Zekun wrote:
of_find_node_by_name() will decrease the refcount of the device_node.
So, get the device_node before passing to it.

Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
Signed-off-by: Zhang Zekun <zhangzeku...@huawei.com>
---
  drivers/net/ethernet/broadcom/asp2/bcmasp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c 
b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
index a68fab1b05f0..093c8ea72af9 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
@@ -1367,7 +1367,7 @@ static int bcmasp_probe(struct platform_device *pdev)
        bcmasp_core_init(priv);
        bcmasp_core_init_filters(priv);
- ports_node = of_find_node_by_name(dev->of_node, "ethernet-ports");
+       ports_node = of_find_node_by_name_balanced(dev->of_node, 
"ethernet-ports");

Why this cannot be of_get_child_by_name()?

Best regards,
Krzysztof

Thanks for point out. After looking into Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml, it should be of_get_child_by_name().

Best regards,
Zekun

Reply via email to