Commit a2b2a19f authored by Sean Wang's avatar Sean Wang Committed by David S. Miller

net: ethernet: mediatek: remove superfluous local variable for phy address

remove the unused variable for parsing PHY address
and the related logic for sanity test which would
be all already handled done when of_mdiobus_register
was called
Reported-by: default avatarNelson Chang <nelson.chang@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2364c5c5
...@@ -226,17 +226,9 @@ static void mtk_phy_link_adjust(struct net_device *dev) ...@@ -226,17 +226,9 @@ static void mtk_phy_link_adjust(struct net_device *dev)
static int mtk_phy_connect_node(struct mtk_eth *eth, struct mtk_mac *mac, static int mtk_phy_connect_node(struct mtk_eth *eth, struct mtk_mac *mac,
struct device_node *phy_node) struct device_node *phy_node)
{ {
const __be32 *_addr = NULL;
struct phy_device *phydev; struct phy_device *phydev;
int phy_mode, addr; int phy_mode;
_addr = of_get_property(phy_node, "reg", NULL);
if (!_addr || (be32_to_cpu(*_addr) >= 0x20)) {
pr_err("%s: invalid phy address\n", phy_node->name);
return -EINVAL;
}
addr = be32_to_cpu(*_addr);
phy_mode = of_get_phy_mode(phy_node); phy_mode = of_get_phy_mode(phy_node);
if (phy_mode < 0) { if (phy_mode < 0) {
dev_err(eth->dev, "incorrect phy-mode %d\n", phy_mode); dev_err(eth->dev, "incorrect phy-mode %d\n", phy_mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment