提交 b5f09df2 编写于 作者: M Marek Vasut 提交者: Tom Rini

net: phy: micrel: Try default PHY ofnode first

The phydev structure has a PHY OF node pointer in it, use that OF node
first when looking up PHY OF node properties, since that is likely the
correct PHY OF node pointer. If the pointer is not valid, which is the
case e.g. on legacy DTs, fall back to parsing MAC ethernet-phy subnode.
Signed-off-by: NMarek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
上级 c34a9275
......@@ -120,8 +120,13 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
if (!drv || !drv->writeext)
return -EOPNOTSUPP;
/* Look for a PHY node under the Ethernet node */
node = dev_read_subnode(dev, "ethernet-phy");
node = phydev->node;
if (!ofnode_valid(node)) {
/* Look for a PHY node under the Ethernet node */
node = dev_read_subnode(dev, "ethernet-phy");
}
if (!ofnode_valid(node)) {
/* No node found, look in the Ethernet node */
node = dev_ofnode(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册