[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1412359741-8423-3-git-send-email-walter@vanguardiasur.com.ar>
Date: Fri, 3 Oct 2014 15:09:01 -0300
From: Walter Lozano <walter@...guardiasur.com.ar>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, tobias.klauser@...il.com,
vbridgers2013@...il.com, f.fainelli@...il.com,
nios2-dev@...ts.rocketboards.org, ezequiel@...guardiasur.com.ar,
guido@...guardiasur.com.ar,
Walter Lozano <walter@...guardiasur.com.ar>
Subject: [PATCH net-next 2/2] 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@...guardiasur.com.ar>
---
drivers/net/ethernet/altera/altera_tse_main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index c85d029..b44a5f7 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)
priv->phy_iface = of_get_phy_mode(np);
+ /* Avoid get phy addr and create mdio if no phy is present */
+ if (!priv->phy_iface)
+ return 0;
+
/* try to get PHY address from device tree, use PHY autodetection if
* no valid address is given
*/
@@ -770,6 +774,10 @@ static int init_phy(struct net_device *dev)
struct phy_device *phydev;
struct device_node *phynode;
+ /* Avoid init phy in case of no phy present */
+ if (!priv->phy_iface)
+ return 0;
+
priv->oldlink = 0;
priv->oldspeed = 0;
priv->oldduplex = -1;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists