net: netcp: ethss: get phy-handle only if link interface is MAC-to-PHY
authorKaricheri, Muralidharan <m-karicheri2@ti.com>
Fri, 6 Jan 2017 20:37:42 +0000 (15:37 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jan 2017 02:03:50 +0000 (21:03 -0500)
Currently to parse phy-handle, driver doesn't check if the interface is
MAC to PHY. This patch add this check for all MAC to PHY interface types
supported by the driver.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/netcp_ethss.c

index 7d9e36f66735cfd7da35f5df0f17c4d003dc4e0c..4a64b3e5c7a00fc81e3c12f3f859569dff743e4a 100644 (file)
@@ -2930,7 +2930,9 @@ static int init_slave(struct gbe_priv *gbe_dev, struct gbe_slave *slave,
        }
 
        slave->open = false;
-       slave->phy_node = of_parse_phandle(node, "phy-handle", 0);
+       if ((slave->link_interface == SGMII_LINK_MAC_PHY) ||
+           (slave->link_interface == XGMII_LINK_MAC_PHY))
+               slave->phy_node = of_parse_phandle(node, "phy-handle", 0);
        slave->port_num = gbe_get_slave_port(gbe_dev, slave->slave_num);
 
        if (slave->link_interface >= XGMII_LINK_MAC_PHY)