提交 42e87024 编写于 作者: J Jose Abreu 提交者: David S. Miller

net: stmmac: Fix case when PHY handle is not present

Some DT bindings do not have the PHY handle. Let's fallback to manually
discovery in case phylink_of_phy_connect() fails.

Changes from v1:
	- Fixup comment style (Sergei)

Fixes: 74371272 ("net: stmmac: Convert to phylink and remove phylib logic")
Reported-by: NKatsuhiro Suzuki <katsuhiro@katsuster.net>
Tested-by: NKatsuhiro Suzuki <katsuhiro@katsuster.net>
Signed-off-by: NJose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ee7dd773
......@@ -953,9 +953,13 @@ static int stmmac_init_phy(struct net_device *dev)
node = priv->plat->phylink_node;
if (node) {
if (node)
ret = phylink_of_phy_connect(priv->phylink, node, 0);
} else {
/* Some DT bindings do not set-up the PHY handle. Let's try to
* manually parse it
*/
if (!node || ret) {
int addr = priv->plat->phy_addr;
struct phy_device *phydev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册