aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Lozano <walter@vanguardiasur.com.ar>2014-10-03 14:09:01 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-05 21:39:40 -0400
commit3354313e504ab51d620388fb230e17cd9097388c (patch)
tree792764c5fde2d532f383d133b9d0b1b045bb0d8e
parent004fa11861f89c54c8839119a99e87b6164dcc2c (diff)
Altera TSE: Add support for no PHY
This patch avoids PHY and MDIO probing if no PHY chip is present. This is the case mainly in optical links where there is no need for PHY chip, and therefore no need of MDIO. In this scenario Ethernet MAC is directly connected to an optical module through an external SFP transceiver. Signed-off-by: Walter Lozano <walter@vanguardiasur.com.ar> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/altera/altera_tse_main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 95a30a30f7ff..4efc4355d345 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -736,6 +736,10 @@ static int altera_tse_phy_get_addr_mdio_create(struct net_device *dev)
736 736
737 priv->phy_iface = of_get_phy_mode(np); 737 priv->phy_iface = of_get_phy_mode(np);
738 738
739 /* Avoid get phy addr and create mdio if no phy is present */
740 if (!priv->phy_iface)
741 return 0;
742
739 /* try to get PHY address from device tree, use PHY autodetection if 743 /* try to get PHY address from device tree, use PHY autodetection if
740 * no valid address is given 744 * no valid address is given
741 */ 745 */
@@ -770,6 +774,10 @@ static int init_phy(struct net_device *dev)
770 struct phy_device *phydev; 774 struct phy_device *phydev;
771 struct device_node *phynode; 775 struct device_node *phynode;
772 776
777 /* Avoid init phy in case of no phy present */
778 if (!priv->phy_iface)
779 return 0;
780
773 priv->oldlink = 0; 781 priv->oldlink = 0;
774 priv->oldspeed = 0; 782 priv->oldspeed = 0;
775 priv->oldduplex = -1; 783 priv->oldduplex = -1;