mirror of
https://github.com/LiBwrt-op/openwrt-6.x.git
synced 2025-12-18 09:47:32 +00:00
37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
From 309a1a330ccaa103a7648e944d97a0032116b338 Mon Sep 17 00:00:00 2001
|
|
From: hzy <hzyitc@outlook.com>
|
|
Date: Mon, 22 Apr 2024 21:50:39 +0800
|
|
Subject: [PATCH] nss_dp_main: support fixed-link
|
|
|
|
Signed-off-by: hzy <hzyitc@outlook.com>
|
|
---
|
|
nss_dp_main.c | 15 ++++++++++++---
|
|
1 file changed, 12 insertions(+), 3 deletions(-)
|
|
|
|
--- a/nss_dp_main.c
|
|
+++ b/nss_dp_main.c
|
|
@@ -634,11 +634,20 @@ static int32_t nss_dp_of_get_pdata(struc
|
|
}
|
|
|
|
dp_priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
|
- if (!dp_priv->phy_node) {
|
|
- pr_err("%s: error parsing phy-handle\n", np->name);
|
|
- return -EFAULT;
|
|
+ if(!dp_priv->phy_node) {
|
|
+ if(of_phy_is_fixed_link(np)) {
|
|
+ int ret = of_phy_register_fixed_link(np);
|
|
+ if(ret < 0) {
|
|
+ pr_err("%s: fail to register fixed-link: %d\n", np->name, ret);
|
|
+ return -EFAULT;
|
|
+ }
|
|
+ }
|
|
+ dp_priv->phy_node = of_node_get(np);
|
|
}
|
|
|
|
+ if(!dp_priv->phy_node)
|
|
+ pr_err("%s: no phy-handle or fixed-link found\n", np->name);
|
|
+
|
|
if (of_property_read_u32(np, "qcom,mactype", &hal_pdata->mactype)) {
|
|
pr_err("%s: error reading mactype\n", np->name);
|
|
return -EFAULT;
|